interface DateRangeInputProps { startDate: string; endDate: string; onStartChange: (value: string) => void; onEndChange: (value: string) => void; startLabel?: string; endLabel?: string; } /** 시작일~종료일 날짜 입력 (자동 보정) */ export default function DateRangeInput({ startDate, endDate, onStartChange, onEndChange, startLabel = "시작일", endLabel = "종료일", }: DateRangeInputProps) { const handleStartChange = (value: string) => { onStartChange(value); if (endDate && value > endDate) onEndChange(value); }; const handleEndChange = (value: string) => { onEndChange(value); if (startDate && value < startDate) onStartChange(value); }; return ( <> {/* 시작일 */}
calendar_today handleStartChange(e.target.value)} className="w-full h-[38px] pl-10 pr-3 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors" />
~ {/* 종료일 */}
calendar_today handleEndChange(e.target.value)} className="w-full h-[38px] pl-10 pr-3 border border-gray-300 rounded-lg text-sm focus:ring-2 focus:ring-primary/20 focus:border-primary transition-colors" />
); }