"use client";
import { jsx } from "react/jsx-runtime";
import * as React from "react";
import { ArrowDown, ArrowUp, Circle, TriangleAlert } from "lucide-react";
import { useT } from "@open-mercato/shared/lib/i18n/context";
import { cn } from "@open-mercato/shared/lib/utils";
import { SimpleTooltip, TooltipProvider } from "@open-mercato/ui/primitives/tooltip";
import {
  getPriorityBadgeClassName,
  getPriorityLabelKey,
  getPriorityFallbackLabel
} from "../../lib/priorityUtils.js";
function PriorityBadge({ priority, className }) {
  const t = useT();
  const priorityTitle = t("messages.priority", "Priority");
  const priorityLabel = React.useMemo(() => {
    return t(getPriorityLabelKey(priority), getPriorityFallbackLabel(priority));
  }, [priority, t]);
  const tooltipText = `${priorityTitle}: ${priorityLabel}`;
  const Icon = React.useMemo(() => {
    switch (priority) {
      case "low":
        return ArrowDown;
      case "high":
        return ArrowUp;
      case "urgent":
        return TriangleAlert;
      case "normal":
      default:
        return Circle;
    }
  }, [priority]);
  return /* @__PURE__ */ jsx(TooltipProvider, { delayDuration: 250, children: /* @__PURE__ */ jsx(SimpleTooltip, { content: tooltipText, children: /* @__PURE__ */ jsx(
    "span",
    {
      className: cn(
        "inline-flex h-6 w-6 items-center justify-center rounded-md border",
        getPriorityBadgeClassName(priority),
        className
      ),
      "aria-label": tooltipText,
      title: tooltipText,
      children: /* @__PURE__ */ jsx(Icon, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
    }
  ) }) });
}
var PriorityBadge_default = PriorityBadge;
export {
  PriorityBadge,
  PriorityBadge_default as default
};
//# sourceMappingURL=PriorityBadge.js.map
