<flux:main>
    @include('components.setting-tabs')

    <div class="flex flex-col gap-4 mt-4">
        <div class="flex flex-col lg:flex-row gap-4">
            <div class="w-full lg:w-3/4 space-y-4">
                <div class="grid grid-cols-1 gap-4 lg:grid-cols-2 items-start">
                    <div class="col-span-1 lg:col-span-2">
                        <flux:card class="space-y-6 p-6">
                            <div class="grid grid-cols-1 md:grid-cols-2 gap-6">
                                <div class="md:col-span-2">
                                    <flux:field>
                                        <flux:label>Nama Lengkap <span class="text-red-500 ms-1">*</span>
                                        </flux:label>
                                        <flux:input placeholder="Yoga Pangestu"
                                            wire:model.live.debounce.500ms="form.full_name" autofocus
                                            autocomplete="off" />
                                        <flux:error name="form.full_name" />
                                    </flux:field>
                                </div>

                                <flux:field>
                                    <flux:label>Nomor Telepon <span class="text-red-500 ms-1">*</span></flux:label>
                                    <flux:input placeholder="0821 xxxx xxxx" mask="9999 9999 99999"
                                        wire:model.live.debounce.500ms="form.phone_number" autocomplete="off" />
                                    <flux:error name="form.phone_number" />
                                </flux:field>

                                <flux:field>
                                    <flux:label>Gaji Pokok</flux:label>
                                    <flux:input.group>
                                        <flux:input.group.prefix>Rp</flux:input.group.prefix>
                                        <flux:input wire:model="form.base_salary" readonly placeholder="1.500.000" />
                                    </flux:input.group>
                                    <flux:error name="form.base_salary" />
                                </flux:field>

                                <flux:field>
                                    <flux:label>Tanggal Lahir <span class="text-red-500 ms-1">*</span></flux:label>
                                    <flux:date-picker with-today wire:model.live.debounce.500ms="form.birthdate"
                                        placeholder="Pilih Tanggal" autocomplete="off" locale="id-ID"
                                        selectable-header />
                                    <flux:error name="form.birthdate" />
                                </flux:field>

                                <flux:input label="Tanggal Bergabung" wire:model="form.hire_date" readonly />

                                <div class="md:col-span-2">
                                    <flux:field>
                                        <flux:label>Alamat <span class="text-red-500 ms-1">*</span></flux:label>
                                        <flux:textarea
                                            placeholder="Jl. Taman Pahlawan No.41, Nagri Kaler, Kec. Purwakarta, Kabupaten Purwakarta, Jawa Barat 41119"
                                            wire:model.live.debounce.500ms="form.address" autocomplete="off"
                                            rows="2" />
                                        <flux:error name="form.address" />
                                    </flux:field>
                                </div>
                            </div>
                        </flux:card>
                    </div>
                </div>
            </div>

            <div class="w-full lg:w-1/3 space-y-4">
                <flux:card class="space-y-6 p-6">
                    <flux:field>
                        <flux:label>Jenis Kelamin <span class="text-red-500 ms-1">*</span></flux:label>
                        <flux:radio.group wire:model.live="form.gender" variant="buttons" class="w-full *:flex-1">
                            @foreach (\App\Enums\Gender::cases() as $gender)
                                <flux:radio value="{{ $gender->value }}">
                                    {{ $gender->label() }}
                                </flux:radio>
                            @endforeach
                        </flux:radio.group>
                        <flux:error name="form.gender" />
                    </flux:field>
                </flux:card>

                <flux:card class="space-y-6 p-6">
                    <flux:input label="Status Kerja" wire:model="form.status" readonly />
                </flux:card>
            </div>
        </div>
    </div>

    @can('update profile')
        <div class="flex justify-start mt-4">
            <flux:button variant="primary" class="sm:w-auto cursor-pointer" wire:click="update">
                Simpan
            </flux:button>
        </div>
    @endcan
</flux:main>
