import type { ReactNode } from "react";
import type { StatusPillProps } from "@/components/atoms/status-pill";

/**
 * Status configuration for a single status value.
 * Maps a status string to its visual representation.
 */
export interface StatusConfig {
  /** The visual variant/color for this status */
  variant: StatusPillProps["variant"];
  /** Optional icon to display */
  icon?: ReactNode;
  /** Display label (defaults to the status key if not provided) */
  label?: string;
}

/**
 * A map of status values to their configurations.
 * Keys should be lowercase for case-insensitive matching.
 */
export type StatusConfigMap<T extends string = string> = Partial<
  Record<Lowercase<T>, StatusConfig>
>;

/**
 * Props for the StatusBadge molecule.
 */
export interface StatusBadgeProps<T extends string = string> extends Omit<
  StatusPillProps,
  "variant" | "icon" | "label"
> {
  /** The status value to display */
  status: T;
  /** Configuration map for status values */
  configMap?: StatusConfigMap<T>;
  /** Whether to show the icon (default: true) */
  showIcon?: boolean;
  /** Default config for unknown statuses */
  defaultConfig?: StatusConfig;
}
