'use client' import React from 'react' import { Button, Switch, FormControlLabel } from '@mui/material' import Grid from '@mui/material/Grid2' import CustomAutocomplete from '@/@core/components/mui/Autocomplete' import CustomTextField from '@/@core/components/mui/TextField' import { DropdownOption, PurchaseOrderFormData } from '@/types/apps/purchaseOrderTypes' interface PurchaseBasicInfoProps { formData: PurchaseOrderFormData handleInputChange: (field: keyof PurchaseOrderFormData, value: any) => void } const PurchaseBasicInfo: React.FC = ({ formData, handleInputChange }) => { // Sample data for dropdowns const vendorOptions: DropdownOption[] = [ { label: 'Vendor A', value: 'vendor_a' }, { label: 'Vendor B', value: 'vendor_b' }, { label: 'Vendor C', value: 'vendor_c' } ] const terminOptions: DropdownOption[] = [ { label: 'Net 30', value: 'net_30' }, { label: 'Net 15', value: 'net_15' }, { label: 'Net 60', value: 'net_60' }, { label: 'Cash on Delivery', value: 'cod' } ] const ekspedisiOptions: DropdownOption[] = [ { label: 'JNE', value: 'jne' }, { label: 'J&T Express', value: 'jnt' }, { label: 'SiCepat', value: 'sicepat' }, { label: 'Pos Indonesia', value: 'pos' }, { label: 'TIKI', value: 'tiki' } ] return ( <> {/* Row 1 - Vendor dan Nomor */} handleInputChange('vendor', newValue)} renderInput={params => } /> ) => handleInputChange('nomor', e.target.value)} InputProps={{ readOnly: true }} /> {/* Row 2 - Tgl. Transaksi, Tgl. Jatuh Tempo, Termin */} ) => handleInputChange('tglTransaksi', e.target.value)} InputLabelProps={{ shrink: true }} /> ) => handleInputChange('tglJatuhTempo', e.target.value)} InputLabelProps={{ shrink: true }} /> handleInputChange('termin', newValue)} renderInput={params => } /> {/* Row 3 - Tampilkan Informasi Pengiriman */} {/* Shipping Information - Conditional */} {formData.showShippingInfo && ( <> ) => handleInputChange('tanggalPengiriman', e.target.value) } InputLabelProps={{ shrink: true }} /> handleInputChange('ekspedisi', newValue)} renderInput={params => ( )} /> ) => handleInputChange('noResi', e.target.value)} /> )} {/* Row 4 - Referensi, SKU, Switch Pajak */} ) => handleInputChange('referensi', e.target.value)} /> ) => handleInputChange('hargaTermasukPajak', e.target.checked) } color='primary' /> } label='Harga termasuk pajak' sx={{ marginLeft: 0, '& .MuiFormControlLabel-label': { fontSize: '14px', color: 'text.secondary' } }} /> ) } export default PurchaseBasicInfo