import type { ReactNode } from "react";
import type { UserConsentState } from "@repo/core-consent";

export type { UserConsentState };

export interface CookieCategory {
  id: string;
  label: string;
  description: string;
  /** Required categories are always enabled and non-toggleable (e.g., essential). */
  required: boolean;
}

export interface ConsentCookieState {
  _v: 1;
  categories: Record<string, boolean>;
}

export interface HeaderRenderProps {
  title: string;
}

export interface CategoryRowRenderProps {
  category: CookieCategory;
  enabled: boolean;
  onToggle: (id: string, enabled: boolean) => void;
}

export interface ActionsRenderProps {
  onRejectAll: () => void;
  onAcceptAll: () => void;
  onSaveSelected: () => void;
}

export interface CookieConsentBannerProps {
  variant: "modal" | "banner";
  categories?: CookieCategory[];
  onConsentChange?: (states: UserConsentState[]) => void;
  renderHeader?: (props: HeaderRenderProps) => ReactNode;
  renderCategoryRow?: (props: CategoryRowRenderProps) => ReactNode;
  renderActions?: (props: ActionsRenderProps) => ReactNode;
}
