import Link from "next/link";

import { ShellPage } from "@/components/page-templates";
import { TablePlaceholder } from "@/components/placeholders";
import { getAgentMentionedConversations } from "@/lib/inbox-ops";

export default async function AgentMentionedPage() {
  const rows = await getAgentMentionedConversations();

  return (
    <ShellPage shell="agent" title="Mentioned Conversations" description="Conversation yang melibatkan agent secara khusus.">
      <TablePlaceholder
        title="Mentioned"
        columns={["Conversation", "Mentioned by", "Time"]}
        rows={rows.map((item) => [
          <Link key={`${item.id}-conv`} className="text-primary underline" href={`/agent/inbox?conversationId=${item.id}`}>
            {item.contactName}
          </Link>,
          item.mentionedBy,
          item.time
        ])}
      />
    </ShellPage>
  );
}
