'use client';

import { CalendarDaySelect } from '@/components/ui/shared/CalendarDaySelect';

interface ScheduleDayPickerProps {
  value: Date;
  onChange: (day: Date) => void;
  label?: string;
  /** Show a "Today" toggle that jumps to the current local day when enabled. Default true. */
  showTodayToggle?: boolean;
  /** One-line control (no “Schedule date” label); Today sits on the navigator. */
  compact?: boolean;
  className?: string;
}

/**
 * Calendar day navigator (arrows + year/month/day panel).
 * Does not restrict past dates — parent pages enforce read-only vs editable for schedule grids/forms.
 */
export function ScheduleDayPicker({
  value,
  onChange,
  label,
  showTodayToggle = true,
  compact = false,
  className,
}: ScheduleDayPickerProps) {
  return (
    <CalendarDaySelect
      value={value}
      onChange={onChange}
      label={compact ? '' : label}
      showHeader={!compact}
      showTodayToggle={showTodayToggle}
      showNavArrows
      className={className}
    />
  );
}
