import type { ComponentProps, ElementType } from "react";
import { Bug, Lightbulb, Wrench } from "lucide-react";

import { Badge } from "@/components/ui/badge";

import type { FeedbackStatus, FeedbackType, Priority } from "./types";

export type BadgeVariant = ComponentProps<typeof Badge>["variant"];

export const TYPE_META: Record<
  FeedbackType,
  { label: string; icon: ElementType; variant: BadgeVariant }
> = {
  idea: { label: "Idea", icon: Lightbulb, variant: "secondary" },
  enhancement: { label: "Enhancement", icon: Wrench, variant: "info" },
  bug: { label: "Bug", icon: Bug, variant: "destructive" },
};

export const PRIORITY_META: Record<
  Priority,
  { label: string; variant: BadgeVariant }
> = {
  low: { label: "Low", variant: "secondary" },
  medium: { label: "Medium", variant: "info" },
  high: { label: "High", variant: "warning" },
  critical: { label: "Critical", variant: "destructive" },
};

export const STATUS_META: Record<
  FeedbackStatus,
  { label: string; variant: BadgeVariant }
> = {
  new: { label: "New", variant: "info" },
  "in-progress": { label: "In progress", variant: "warning" },
  resolved: { label: "Resolved", variant: "success" },
  declined: { label: "Declined", variant: "outline" },
};
