import { Badge as BaseBadge } from "@mosaic/ui";
import type { BadgeProps as BaseBadgeProps, BadgeVariant as BaseBadgeVariant } from "@mosaic/ui";

// Extend BadgeVariant to include shadcn/ui variants
export type BadgeVariant = BaseBadgeVariant | "secondary" | "outline" | "default" | "destructive";

export interface BadgeProps extends Omit<BaseBadgeProps, "variant"> {
  variant?: BadgeVariant;
}

// Map extended variants to base variants
const variantMap: Record<string, BaseBadgeVariant> = {
  secondary: "status-neutral",
  outline: "status-info",
  default: "status-neutral",
  destructive: "status-error",
};

export function Badge({ variant = "default", ...props }: BadgeProps): React.JSX.Element {
  const mappedVariant = (variantMap[variant] ?? variant) as BaseBadgeVariant;
  return <BaseBadge variant={mappedVariant} {...props} />;
}
