@extends('layouts.app')
@section('title', 'New Delivery Challan')
@section('breadcrumb')
    @include('components.breadcrumb', ['items' => ['Challan' => route('challan.index'), 'New' => null]])
@endsection
@section('content')
<div class="max-w-3xl mx-auto">
    <x-card title="New Delivery Challan" icon="truck">
        <form action="{{ route('challan.store') }}" method="POST" class="space-y-4">
            @csrf
            <div class="grid grid-cols-1 sm:grid-cols-2 gap-4">
                <x-form-input name="party_id" label="Customer" type="select" icon="user" :options="$customers->pluck('name','id')" required />
                <x-form-input name="challan_date" label="Challan Date" type="date" icon="calendar" :value="now()->format('Y-m-d')" required />
                <x-form-input name="vehicle_no" label="Vehicle No" icon="truck" placeholder="DHKA-METRO-1234" />
                <x-form-input name="driver_name" label="Driver Name" icon="user" />
                <x-form-input name="driver_phone" label="Driver Phone" icon="phone" />
                <x-form-input name="transport" label="Transport Name" icon="shipping" />
            </div>
            <x-form-input name="remarks" label="Remarks" type="textarea" icon="message-square" />
            <div class="flex justify-end gap-2 pt-2">
                <x-button variant="secondary" :href="route('challan.index')">Cancel</x-button>
                <x-button variant="primary" icon="save" type="submit">Create Challan</x-button>
            </div>
        </form>
    </x-card>
</div>
@endsection
