{% load i18n %}

<div>
    <div class="card mt-4 pt-2 ps-lg-2">
        <h5 class="card-header">{% trans "Type" %} [[ this.$route.params.id ]]</h5>
        <div class="card-body">

            <v-container fluid v-if="object">
                <template v-for="field in headers">
                    <v-row v-if="field.details">
                        <v-col cols="4">
                            <v-subheader>[[ field.text ]]</v-subheader>
                        </v-col>
                        <v-col cols="8">
                            <v-text-field :value="object[field.value]" readonly dense></v-text-field>
                        </v-col>
                    </v-row>
                </template>
            </v-container>

        </div>
    </div>

    <div class="card mt-4 pt-2 ps-lg-2">
        <h5 class="card-header">{% trans "Items" %}</h5>
        <div class="card-body">

            <ItemList
                :items="all_items"
                :items_headers="items_headers"
                :items_relations="{'type': [object]}"
                group_by="type__name"
                @deleteItem="deleteItem"
                @createItem="createItem"
                @editItem="editItem"
            ></ItemList>

        </div>
    </div>
</div>
