"use client";
import { jsx, jsxs } from "react/jsx-runtime";
import { Calendar, ChevronRight } from "lucide-react";
import { Button } from "@open-mercato/ui/primitives/button";
function UpcomingMeetingsWidget({ meetings, t }) {
  if (meetings.length === 0) {
    return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-5", children: [
      /* @__PURE__ */ jsxs("h3", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
        /* @__PURE__ */ jsx(Calendar, { className: "size-4" }),
        t("customers.companies.dashboard.upcomingMeetings", "Upcoming meetings")
      ] }),
      /* @__PURE__ */ jsx("p", { className: "mt-3 text-sm text-muted-foreground", children: t("customers.companies.dashboard.noMeetings", "No upcoming meetings") })
    ] });
  }
  return /* @__PURE__ */ jsxs("div", { className: "rounded-lg border bg-card p-5", children: [
    /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
      /* @__PURE__ */ jsxs("h3", { className: "flex items-center gap-2 text-sm font-semibold text-foreground", children: [
        /* @__PURE__ */ jsx(Calendar, { className: "size-4" }),
        t("customers.companies.dashboard.upcomingMeetings", "Upcoming meetings"),
        /* @__PURE__ */ jsx("span", { className: "rounded-full bg-muted px-1.5 py-0.5 text-xs font-medium text-muted-foreground", children: meetings.length })
      ] }),
      /* @__PURE__ */ jsxs(Button, { type: "button", variant: "link", size: "sm", className: "h-auto p-0 text-xs", children: [
        t("customers.companies.dashboard.seeAll", "See all"),
        /* @__PURE__ */ jsx(ChevronRight, { className: "ml-0.5 size-3" })
      ] })
    ] }),
    /* @__PURE__ */ jsx("div", { className: "mt-3 divide-y", children: meetings.map((meeting) => {
      const date = meeting.scheduledAt ? new Date(meeting.scheduledAt) : null;
      return /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-4 py-3 first:pt-0 last:pb-0", children: [
        /* @__PURE__ */ jsxs("div", { className: "min-w-0 flex-1", children: [
          /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx("span", { className: "text-xs text-muted-foreground", children: date ? date.toLocaleDateString(void 0, { weekday: "short", month: "short", day: "numeric" }) : "\u2014" }) }),
          /* @__PURE__ */ jsx("p", { className: "mt-0.5 truncate text-sm font-medium text-foreground", children: meeting.title || meeting.interactionType }),
          meeting.authorName && /* @__PURE__ */ jsx("p", { className: "text-xs text-muted-foreground", children: meeting.authorName })
        ] }),
        /* @__PURE__ */ jsx("div", { className: "flex shrink-0 items-center gap-2", children: /* @__PURE__ */ jsx(Button, { type: "button", variant: "outline", size: "sm", className: "h-7 text-xs", children: t("customers.companies.dashboard.details", "Details") }) })
      ] }, meeting.id);
    }) })
  ] });
}
export {
  UpcomingMeetingsWidget
};
//# sourceMappingURL=UpcomingMeetingsWidget.js.map
