<template>
    <div class="card-section space-y-6">
        <div class="grid grid-cols-1 md:grid-cols-2 gap-5">
            <UFormField label="Stock quantity">
                <UInputNumber v-model="store.form.quantity" :min="0" class="w-full" />
            </UFormField>

            <UFormField label="Minimum order quantity">
                <UInputNumber v-model="store.form.minimal_quantity" :min="1" class="w-full" />
            </UFormField>
        </div>

        <UFormField label="When out of stock">
            <USelect v-model="store.form.out_of_stock" :options="outOfStockOptions" value-key="value"
                label-key="label" class="w-72" />
        </UFormField>
    </div>
</template>

<script setup lang="ts">
import { useAddProductStore } from '@/stores/admin/addProduct'

const store = useAddProductStore()

const outOfStockOptions = [
    { value: 0, label: 'Deny orders' },
    { value: 1, label: 'Allow orders' },
    { value: 2, label: 'Use shop default' },
]
</script>
