import { Calendar, Fuel, RefreshCw, Truck } from 'lucide-react'; import type { CustomerType, DateQuickPick } from '../types'; import type { HydrogenDailyVehicleScope } from '../hydrogen-daily/model'; import { QUICK_PICK_OPTIONS, type RangeMode } from './model'; interface DailyRangeControlsProps { pick: RangeMode; dateRange: { start: string; end: string }; customer: CustomerType; stations?: { id: number; name: string }[]; selectedStationId?: number | null; vehicleScope?: HydrogenDailyVehicleScope; updatedAt?: string | null; loading?: boolean; onQuickPick: (pick: DateQuickPick) => void; onCustomPick: () => void; onDateRangeChange: (field: 'start' | 'end', value: string) => void; onCustomerChange: (customer: CustomerType) => void; onStationChange?: (stationId: number | null) => void; onVehicleScopeChange?: (scope: HydrogenDailyVehicleScope) => void; onRefresh?: () => void; } export default function DailyRangeControls({ pick, dateRange, customer, stations = [], selectedStationId = null, vehicleScope, updatedAt, loading = false, onQuickPick, onCustomPick, onDateRangeChange, onCustomerChange, onStationChange, onVehicleScopeChange, onRefresh, }: DailyRangeControlsProps) { return (
{QUICK_PICK_OPTIONS.map(option => ( ))}
onDateRangeChange('start', value)} /> onDateRangeChange('end', value)} /> {onStationChange ? ( ) : null}
{onVehicleScopeChange && vehicleScope ? (
{([ ['all', '全部车辆'], ['lingniu', '仅羚牛车辆'], ['external', '仅外部车辆'], ] as const).map(([id, label]) => ( ))}
) : (
{(['lingniu', 'external'] as const).map(option => ( ))}
)}
{updatedAt ? {updatedAt} : null} {onRefresh ? ( ) : null}
); } function DateField({ label, value, onChange }: { label: string; value: string; onChange: (value: string) => void }) { return ( ); }