import type { ReactNode } from 'react';

export type SelectOption = {
  value: string;
  label: string;
  disabled?: boolean;
};

export type DataTableColumn<T extends Record<string, unknown> = Record<string, unknown>> = {
  id: string;
  label: string;
  width?: string;
  className?: string | ((row: T) => string);
  style?: React.CSSProperties | ((row: T) => React.CSSProperties);
  onClick?: (row: T, value: unknown) => void;
  link?: (row: T) => string;
  sortable?: boolean;
  accessor?: (row: T) => unknown;
  groupable?: boolean;
  parentHeader?: string;
  colspan?: number;
  align?: 'left' | 'center' | 'right';
  borders?: { left?: boolean; right?: boolean; top?: boolean; bottom?: boolean };
  renderCell?: (row: T, index: number) => ReactNode;
};

export type DateRangeValue = {
  start: Date | null;
  end: Date | null;
};

export type DropdownOption<T = unknown> = {
  value: T;
  label: string;
  disabled?: boolean;
  selected?: boolean;
};

export type BadgeVariant =
  | 'default'
  | 'primary'
  | 'secondary'
  | 'success'
  | 'danger'
  | 'warning'
  | 'info'
  | 'light'
  | 'dark'
  | 'custom'
  /** @deprecated use `danger` */
  | 'error';
export type BadgeTone = 'solid' | 'soft';
export type BadgeSize = 'sm' | 'md' | 'lg';
export type BadgeShape = 'rounded' | 'pill' | 'square';

export type LoadingVariant = 'spinner' | 'bar' | 'pulse';
export type LoadingSize = 'sm' | 'md' | 'lg';
/** Accent palette for loading indicators */
export type LoadingColor =
  | 'primary'
  | 'secondary'
  | 'success'
  | 'danger'
  | 'warning'
  | 'info'
  | 'light'
  | 'dark';

/** Accent palette for progress components */
export type ProgressColor = LoadingColor;

/** Spinner ring stroke + pulse dot “weight”; also used for alert border/padding emphasis */
export type LoadingThickness = 'thin' | 'normal' | 'thick';
export type AlertThickness = LoadingThickness;

/** Border emphasis + font weight (same scale as Loading/Alert) */
export type BadgeThickness = LoadingThickness;
