2025-01-09 12:28:37 +00:00
|
|
|
"use client";
|
2024-12-03 02:14:51 +00:00
|
|
|
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
|
|
|
|
import { Tabs, TabsContent, TabsList, TabsTrigger } from "@/components/ui/tabs";
|
|
|
|
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
2024-12-11 18:28:57 +00:00
|
|
|
|
|
|
|
|
import CollaborationTable from "./collaboration/components/collabroation-table";
|
2024-12-19 17:30:43 +00:00
|
|
|
import EscalationTable from "./escalation/components/escalation-table";
|
2025-01-09 12:28:37 +00:00
|
|
|
import { useState } from "react";
|
|
|
|
|
import { Link, useRouter } from "@/i18n/routing";
|
|
|
|
|
import { PlusIcon } from "lucide-react";
|
|
|
|
|
import { Button } from "@/components/ui/button";
|
2025-01-10 12:52:04 +00:00
|
|
|
import InternalTable from "./internal/components/internal-table";
|
2025-02-22 10:34:27 +00:00
|
|
|
import { useTranslations } from "next-intl";
|
2024-12-03 02:14:51 +00:00
|
|
|
|
2024-12-13 06:55:30 +00:00
|
|
|
const CommunicationPage = () => {
|
2025-01-18 15:13:47 +00:00
|
|
|
const [tab, setTab] = useState("Pertanyaan Internal");
|
2025-02-22 10:34:27 +00:00
|
|
|
const t = useTranslations("Communication");
|
2024-12-03 02:14:51 +00:00
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<SiteBreadcrumb />
|
2025-01-09 12:28:37 +00:00
|
|
|
<div className="w-full overflow-x-auto bg-white p-4 rounded-sm space-y-3">
|
|
|
|
|
<div className="flex justify-between py-3">
|
|
|
|
|
<p className="text-lg">{tab}</p>
|
2025-01-18 15:13:47 +00:00
|
|
|
{tab === "Pertanyaan Internal" && (
|
2025-01-09 12:28:37 +00:00
|
|
|
<Link href="/shared/communication/internal/create">
|
|
|
|
|
<Button color="primary" size="md">
|
2025-04-09 12:19:36 +00:00
|
|
|
<PlusIcon size={18} className="mr-2" />
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("new-question", { defaultValue: "New Question" })}
|
2025-01-09 12:28:37 +00:00
|
|
|
</Button>
|
|
|
|
|
</Link>
|
|
|
|
|
)}
|
|
|
|
|
{tab === "Kolaborasi" && (
|
|
|
|
|
<Link href="/shared/communication/collaboration/create">
|
|
|
|
|
<Button color="primary" size="md">
|
2025-04-09 12:19:36 +00:00
|
|
|
<PlusIcon size={18} className="mr-2" />
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("new-collaboration", { defaultValue: "New Collaboration" })}
|
2025-01-09 12:28:37 +00:00
|
|
|
</Button>
|
|
|
|
|
</Link>
|
|
|
|
|
)}
|
|
|
|
|
</div>
|
2025-02-20 11:29:08 +00:00
|
|
|
<div className="flex flex-wrap gap-1 border-2 rounded-md w-fit mb-5">
|
2025-01-09 12:28:37 +00:00
|
|
|
<Button
|
|
|
|
|
rounded="md"
|
2025-01-18 15:13:47 +00:00
|
|
|
onClick={() => setTab("Pertanyaan Internal")}
|
2025-01-09 12:28:37 +00:00
|
|
|
className={` hover:text-white
|
|
|
|
|
${
|
2025-01-18 15:13:47 +00:00
|
|
|
tab === "Pertanyaan Internal"
|
2025-01-09 12:28:37 +00:00
|
|
|
? "bg-black text-white "
|
|
|
|
|
: "bg-white text-black "
|
|
|
|
|
}`}
|
|
|
|
|
>
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("internal-questions", { defaultValue: "Internal Questions" })}
|
2025-01-09 12:28:37 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
rounded="md"
|
|
|
|
|
onClick={() => setTab("Eskalasi")}
|
|
|
|
|
className={` hover:text-white
|
|
|
|
|
${
|
|
|
|
|
tab === "Eskalasi"
|
|
|
|
|
? "bg-black text-white "
|
|
|
|
|
: "bg-white text-black "
|
|
|
|
|
}`}
|
|
|
|
|
>
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("escalation", { defaultValue: "Escalation" })}
|
2025-01-09 12:28:37 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
rounded="md"
|
|
|
|
|
onClick={() => setTab("Kolaborasi")}
|
|
|
|
|
className={` hover:text-white
|
|
|
|
|
${
|
|
|
|
|
tab === "Kolaborasi"
|
|
|
|
|
? "bg-black text-white "
|
|
|
|
|
: "bg-white text-black "
|
|
|
|
|
}`}
|
|
|
|
|
>
|
2025-07-06 09:23:45 +00:00
|
|
|
{t("collaboration", { defaultValue: "Collaboration" })}
|
2025-01-09 12:28:37 +00:00
|
|
|
</Button>
|
|
|
|
|
</div>
|
2025-01-18 15:13:47 +00:00
|
|
|
{tab === "Pertanyaan Internal" && <InternalTable />}
|
2025-01-09 12:28:37 +00:00
|
|
|
{tab === "Eskalasi" && <EscalationTable />}
|
|
|
|
|
{tab === "Kolaborasi" && <CollaborationTable />}
|
2024-12-03 02:14:51 +00:00
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
);
|
2024-11-27 04:14:10 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default CommunicationPage;
|