"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import Link from "next/link";
import { Mail } from "lucide-react";
import { useT } from "@open-mercato/shared/lib/i18n/context";
import { cn } from "@open-mercato/shared/lib/utils";
import { IconButton } from "../../primitives/icon-button.js";
import { NotificationCountBadge } from "../notifications/NotificationCountBadge.js";
import { useMessages } from "./useMessages.js";
function MessagesIcon({ className }) {
  const t = useT();
  const { unreadCount, hasNew } = useMessages();
  const ariaLabel = unreadCount > 0 ? t("messages.badge.unread", "{count} unread messages", { count: unreadCount }) : t("messages.nav.inbox", "Messages");
  return /* @__PURE__ */ jsx(IconButton, { variant: "ghost", size: "sm", asChild: true, className: cn("relative", className), children: /* @__PURE__ */ jsxs(Link, { href: "/backend/messages", "aria-label": ariaLabel, children: [
    /* @__PURE__ */ jsx(Mail, { className: cn("h-5 w-5", hasNew && "animate-pulse") }),
    /* @__PURE__ */ jsx(NotificationCountBadge, { count: unreadCount })
  ] }) });
}
export {
  MessagesIcon
};
//# sourceMappingURL=MessagesIcon.js.map
