import { type SxProps } from '@mui/material';

export enum WeekMonthPeriod {
  WEEKLY = 'WEEKLY',
  MONTHLY = 'MONTHLY',
}

export type PeriodButton = {
  type: WeekMonthPeriod;
  text: string;
};

export type WeekMonthSelectorProps = {
  /** Start date of the current period */
  fromDate: Date;
  /** End date of the current period. Used for display only in weekly mode — all navigation derives the new end date from fromDate. */
  toDate: Date;
  /** Callback fired when the start date changes */
  handleFromChange: (date: Date) => void;
  /** Callback fired when the end date changes */
  handleToChange: (date: Date) => void;
  /** Formats a date to a string. Accepts an optional date-fns format string. */
  dateFormatter: (date: Date, format?: string) => string;
  /** Initial period shown when the component mounts. Default: WEEKLY */
  initialPeriod?: WeekMonthPeriod;
  /** Callback fired when the user switches between weekly and monthly mode */
  onPeriodChange?: (period: WeekMonthPeriod) => void;
  /** Callback fired specifically when the "current month" shortcut is clicked in the month picker. Fires before handleFromChange/handleToChange so consumers can track it (e.g. analytics). */
  onCurrentMonthClick?: () => void;
  /** SxProps for the root Stack */
  sx?: SxProps;
};
