feat:pertanyaan masuk
This commit is contained in:
parent
2fb9bf047b
commit
832600d093
|
|
@ -0,0 +1,164 @@
|
||||||
|
import * as React from "react";
|
||||||
|
import { ColumnDef } from "@tanstack/react-table";
|
||||||
|
|
||||||
|
import { Eye, MoreVertical, SquarePen, Trash2 } from "lucide-react";
|
||||||
|
import { cn } from "@/lib/utils";
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
DropdownMenuItem,
|
||||||
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
import { Badge } from "@/components/ui/badge";
|
||||||
|
import { format } from "date-fns";
|
||||||
|
import { Link, usePathname, useRouter } from "@/i18n/routing";
|
||||||
|
import { useToast } from "@/components/ui/use-toast";
|
||||||
|
import { deleteDataFAQ } from "@/service/settings/settings";
|
||||||
|
import Swal from "sweetalert2";
|
||||||
|
import withReactContent from "sweetalert2-react-content";
|
||||||
|
import { deleteQuestion } from "@/service/communication/communication";
|
||||||
|
|
||||||
|
const columns: ColumnDef<any>[] = [
|
||||||
|
{
|
||||||
|
accessorKey: "no",
|
||||||
|
header: "No",
|
||||||
|
cell: ({ row }) => <span> {row.getValue("no")}</span>,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "message",
|
||||||
|
header: "Pertanyaan",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="normal-case"> {row.getValue("message")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "commentFromUserName",
|
||||||
|
header: "Penerima",
|
||||||
|
cell: ({ row }) => (
|
||||||
|
<span className="normal-case">{row.getValue("commentFromUserName")}</span>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "type",
|
||||||
|
header: "Channel",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
const type = row.original.type; // Akses properti category
|
||||||
|
return <span className="normal-case">{type?.name || "N/A"}</span>;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "createdAt",
|
||||||
|
header: "Waktu",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
const createdAt = row.getValue("createdAt") as
|
||||||
|
| string
|
||||||
|
| number
|
||||||
|
| undefined;
|
||||||
|
|
||||||
|
const formattedDate =
|
||||||
|
createdAt && !isNaN(new Date(createdAt).getTime())
|
||||||
|
? format(new Date(createdAt), "dd-MM-yyyy HH:mm:ss")
|
||||||
|
: "-";
|
||||||
|
return <span className="whitespace-nowrap">{formattedDate}</span>;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
accessorKey: "isActive",
|
||||||
|
header: "Status",
|
||||||
|
cell: ({ row }) => {
|
||||||
|
const isActive = row.getValue("isActive") as boolean; // Ambil nilai isActive
|
||||||
|
const status = isActive ? "Open" : "Closed"; // Tentukan teks berdasarkan isActive
|
||||||
|
const statusStyles = isActive
|
||||||
|
? "bg-green-100 text-green-600" // Gaya untuk "Open"
|
||||||
|
: "bg-red-100 text-red-600"; // Gaya untuk "Closed"
|
||||||
|
|
||||||
|
return (
|
||||||
|
<Badge className={`rounded-full px-5 ${statusStyles}`}>{status}</Badge>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
{
|
||||||
|
id: "actions",
|
||||||
|
accessorKey: "action",
|
||||||
|
header: "Actions",
|
||||||
|
enableHiding: false,
|
||||||
|
cell: ({ row }) => {
|
||||||
|
const pathname = usePathname();
|
||||||
|
const router = useRouter();
|
||||||
|
const { toast } = useToast();
|
||||||
|
const MySwal = withReactContent(Swal);
|
||||||
|
|
||||||
|
const questionDelete = async (id: string) => {
|
||||||
|
const response = await deleteQuestion(id);
|
||||||
|
console.log(response);
|
||||||
|
if (response?.error) {
|
||||||
|
toast({
|
||||||
|
title: "Error",
|
||||||
|
variant: "destructive",
|
||||||
|
description: "Gagal Delete",
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
toast({
|
||||||
|
title: "Sukses",
|
||||||
|
description: "Berhasil Delete",
|
||||||
|
});
|
||||||
|
router.push(`${pathname}?dataChange=true`);
|
||||||
|
};
|
||||||
|
|
||||||
|
const deleteValidation = async (id: string) => {
|
||||||
|
MySwal.fire({
|
||||||
|
title: "Delete Data",
|
||||||
|
text: "Apakah Anda yakin ingin menghapus data ini?",
|
||||||
|
icon: "warning",
|
||||||
|
showCancelButton: true,
|
||||||
|
cancelButtonColor: "#d33",
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
confirmButtonText: "Delete",
|
||||||
|
}).then((result) => {
|
||||||
|
if (result.isConfirmed) {
|
||||||
|
questionDelete(id);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
};
|
||||||
|
return (
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button
|
||||||
|
size="icon"
|
||||||
|
className="bg-transparent ring-offset-transparent hover:bg-transparent hover:ring-0 hover:ring-transparent"
|
||||||
|
>
|
||||||
|
<span className="sr-only">Open menu</span>
|
||||||
|
<MoreVertical className="h-4 w-4 text-default-800" />
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent className="p-0" align="end">
|
||||||
|
<Link
|
||||||
|
href={`/supervisor/communications/internal/update/${row?.original?.id}`}
|
||||||
|
>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none items-center">
|
||||||
|
Jawab
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href={`/supervisor/communications/forward/detail/${row?.original?.id}`}
|
||||||
|
>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-default focus:text-primary-foreground rounded-none items-center">
|
||||||
|
Eskalasi
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</Link>
|
||||||
|
<a onClick={() => deleteValidation(row?.original?.id)}>
|
||||||
|
<DropdownMenuItem className="p-2 border-b text-default-700 group focus:bg-red-500 focus:text-primary-foreground rounded-none items-center">
|
||||||
|
Delete
|
||||||
|
</DropdownMenuItem>
|
||||||
|
</a>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
|
export default columns;
|
||||||
|
|
@ -0,0 +1,320 @@
|
||||||
|
"use client";
|
||||||
|
|
||||||
|
import * as React from "react";
|
||||||
|
import {
|
||||||
|
ColumnDef,
|
||||||
|
ColumnFiltersState,
|
||||||
|
PaginationState,
|
||||||
|
SortingState,
|
||||||
|
VisibilityState,
|
||||||
|
flexRender,
|
||||||
|
getCoreRowModel,
|
||||||
|
getFilteredRowModel,
|
||||||
|
getPaginationRowModel,
|
||||||
|
getSortedRowModel,
|
||||||
|
useReactTable,
|
||||||
|
} from "@tanstack/react-table";
|
||||||
|
import { Button } from "@/components/ui/button";
|
||||||
|
|
||||||
|
import {
|
||||||
|
Table,
|
||||||
|
TableBody,
|
||||||
|
TableCell,
|
||||||
|
TableHead,
|
||||||
|
TableHeader,
|
||||||
|
TableRow,
|
||||||
|
} from "@/components/ui/table";
|
||||||
|
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar";
|
||||||
|
import {
|
||||||
|
ChevronLeft,
|
||||||
|
ChevronRight,
|
||||||
|
Eye,
|
||||||
|
MoreVertical,
|
||||||
|
Search,
|
||||||
|
SquarePen,
|
||||||
|
Trash2,
|
||||||
|
TrendingDown,
|
||||||
|
TrendingUp,
|
||||||
|
} from "lucide-react";
|
||||||
|
import { cn, getCookiesDecrypt } from "@/lib/utils";
|
||||||
|
import {
|
||||||
|
DropdownMenu,
|
||||||
|
DropdownMenuContent,
|
||||||
|
DropdownMenuItem,
|
||||||
|
DropdownMenuRadioGroup,
|
||||||
|
DropdownMenuRadioItem,
|
||||||
|
DropdownMenuTrigger,
|
||||||
|
} from "@/components/ui/dropdown-menu";
|
||||||
|
import { Input } from "@/components/ui/input";
|
||||||
|
import { InputGroup, InputGroupText } from "@/components/ui/input-group";
|
||||||
|
import { paginationBlog } from "@/service/blog/blog";
|
||||||
|
import { ticketingPagination } from "@/service/ticketing/ticketing";
|
||||||
|
import { Badge } from "@/components/ui/badge";
|
||||||
|
import { useParams, useSearchParams } from "next/navigation";
|
||||||
|
import TablePagination from "@/components/table/table-pagination";
|
||||||
|
import columns from "./columns";
|
||||||
|
import {
|
||||||
|
listDataAudio,
|
||||||
|
listDataImage,
|
||||||
|
listDataVideo,
|
||||||
|
} from "@/service/content/content";
|
||||||
|
import {
|
||||||
|
getQuestionPagination,
|
||||||
|
getTicketingEscalationPagination,
|
||||||
|
listTicketingInternal,
|
||||||
|
} from "@/service/communication/communication";
|
||||||
|
import { usePathname, useRouter } from "@/i18n/routing";
|
||||||
|
|
||||||
|
interface statisticType {
|
||||||
|
incomingTotal: number;
|
||||||
|
createdTicketTotal: number;
|
||||||
|
todayIncomingTotal: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
const QuestionsTable = (props: {
|
||||||
|
statisticData: (data: statisticType) => void;
|
||||||
|
}) => {
|
||||||
|
const router = useRouter();
|
||||||
|
const pathname = usePathname();
|
||||||
|
const searchParams = useSearchParams();
|
||||||
|
const params = useParams();
|
||||||
|
const title = params?.title;
|
||||||
|
const dataChange = searchParams?.get("dataChange");
|
||||||
|
const [dataTable, setDataTable] = React.useState<any[]>([]);
|
||||||
|
const [totalData, setTotalData] = React.useState<number>(1);
|
||||||
|
const [sorting, setSorting] = React.useState<SortingState>([]);
|
||||||
|
const [columnFilters, setColumnFilters] = React.useState<ColumnFiltersState>(
|
||||||
|
[]
|
||||||
|
);
|
||||||
|
const [columnVisibility, setColumnVisibility] =
|
||||||
|
React.useState<VisibilityState>({});
|
||||||
|
const [rowSelection, setRowSelection] = React.useState({});
|
||||||
|
const [showData, setShowData] = React.useState("10");
|
||||||
|
|
||||||
|
const [pagination, setPagination] = React.useState<PaginationState>({
|
||||||
|
pageIndex: 0,
|
||||||
|
pageSize: Number(showData),
|
||||||
|
});
|
||||||
|
const [page, setPage] = React.useState(1);
|
||||||
|
const [totalPage, setTotalPage] = React.useState(1);
|
||||||
|
const [search, setSearch] = React.useState<string>("");
|
||||||
|
|
||||||
|
const roleId = getCookiesDecrypt("urie");
|
||||||
|
|
||||||
|
const table = useReactTable({
|
||||||
|
data: dataTable,
|
||||||
|
columns,
|
||||||
|
onSortingChange: setSorting,
|
||||||
|
onColumnFiltersChange: setColumnFilters,
|
||||||
|
getCoreRowModel: getCoreRowModel(),
|
||||||
|
getPaginationRowModel: getPaginationRowModel(),
|
||||||
|
getSortedRowModel: getSortedRowModel(),
|
||||||
|
getFilteredRowModel: getFilteredRowModel(),
|
||||||
|
onColumnVisibilityChange: setColumnVisibility,
|
||||||
|
onRowSelectionChange: setRowSelection,
|
||||||
|
onPaginationChange: setPagination,
|
||||||
|
state: {
|
||||||
|
sorting,
|
||||||
|
columnFilters,
|
||||||
|
columnVisibility,
|
||||||
|
rowSelection,
|
||||||
|
pagination,
|
||||||
|
},
|
||||||
|
});
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
if (dataChange) {
|
||||||
|
router.push(pathname);
|
||||||
|
}
|
||||||
|
fetchData();
|
||||||
|
}, [dataChange]);
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
const pageFromUrl = searchParams?.get("page");
|
||||||
|
if (pageFromUrl) {
|
||||||
|
setPage(Number(pageFromUrl));
|
||||||
|
}
|
||||||
|
}, [searchParams]);
|
||||||
|
|
||||||
|
React.useEffect(() => {
|
||||||
|
fetchData();
|
||||||
|
setPagination({
|
||||||
|
pageIndex: 0,
|
||||||
|
pageSize: Number(showData),
|
||||||
|
});
|
||||||
|
}, [page, showData]);
|
||||||
|
|
||||||
|
let typingTimer: any;
|
||||||
|
const doneTypingInterval = 1500;
|
||||||
|
|
||||||
|
const handleKeyUp = () => {
|
||||||
|
clearTimeout(typingTimer);
|
||||||
|
typingTimer = setTimeout(doneTyping, doneTypingInterval);
|
||||||
|
};
|
||||||
|
|
||||||
|
const handleKeyDown = () => {
|
||||||
|
clearTimeout(typingTimer);
|
||||||
|
};
|
||||||
|
|
||||||
|
async function doneTyping() {
|
||||||
|
fetchData();
|
||||||
|
}
|
||||||
|
|
||||||
|
async function fetchData() {
|
||||||
|
const typeNow =
|
||||||
|
title === "comment"
|
||||||
|
? "1"
|
||||||
|
: title === "facebook"
|
||||||
|
? "2"
|
||||||
|
: title === "instagram"
|
||||||
|
? "3"
|
||||||
|
: title === "x"
|
||||||
|
? "4"
|
||||||
|
: title === "youtube"
|
||||||
|
? "5"
|
||||||
|
: title === "emergency"
|
||||||
|
? "6"
|
||||||
|
: title === "email"
|
||||||
|
? "7"
|
||||||
|
: title === "inbox"
|
||||||
|
? "8"
|
||||||
|
: title === "whatsapp"
|
||||||
|
? "9"
|
||||||
|
: title === "tiktok"
|
||||||
|
? "10"
|
||||||
|
: "";
|
||||||
|
|
||||||
|
try {
|
||||||
|
const res = await getQuestionPagination(
|
||||||
|
search,
|
||||||
|
page - 1,
|
||||||
|
typeNow,
|
||||||
|
showData
|
||||||
|
);
|
||||||
|
const data = res?.data?.data;
|
||||||
|
const contentData = data?.page?.content;
|
||||||
|
console.log("contentDatassss : ", data);
|
||||||
|
|
||||||
|
contentData.forEach((item: any, index: number) => {
|
||||||
|
item.no = (page - 1) * Number(showData) + index + 1;
|
||||||
|
});
|
||||||
|
setDataTable(contentData);
|
||||||
|
props.statisticData(data?.statistic);
|
||||||
|
setTotalData(data?.page?.totalElements);
|
||||||
|
setTotalPage(data?.page?.totalPages);
|
||||||
|
} catch (error) {
|
||||||
|
console.error("Error fetching tasks:", error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return (
|
||||||
|
<div className="w-full overflow-x-auto bg-white px-6 py-10">
|
||||||
|
<div className="text-xl capitalize flex flex-row gap-5 items-center">
|
||||||
|
{title == "all"
|
||||||
|
? "Pertanyaan Masuk"
|
||||||
|
: title === "inbox"
|
||||||
|
? "Pesan Masuk"
|
||||||
|
: title == "comment"
|
||||||
|
? "Komentar Konten"
|
||||||
|
: title === "emergency"
|
||||||
|
? "Emergency Issue"
|
||||||
|
: title}{" "}
|
||||||
|
<Badge color="secondary" className="text-xl font-normal">
|
||||||
|
{totalData}
|
||||||
|
</Badge>
|
||||||
|
</div>
|
||||||
|
<div className="flex justify-between items-center mt-6">
|
||||||
|
<div className="mt-3 flex flex-row items-center gap-2">
|
||||||
|
<InputGroup merged>
|
||||||
|
<InputGroupText className="bg-transparent dark:border-secondary dark:group-focus-within:border-secondary">
|
||||||
|
<Search className=" h-4 w-4 dark:text-white" />
|
||||||
|
</InputGroupText>
|
||||||
|
<Input
|
||||||
|
type="text"
|
||||||
|
placeholder="Search Judul..."
|
||||||
|
className="bg-transparent dark:border-secondary dark:placeholder-white/80 dark:focus:border-secondary dark:text-white"
|
||||||
|
value={search}
|
||||||
|
onChange={(e) => setSearch(e.target.value)}
|
||||||
|
onKeyDown={handleKeyDown}
|
||||||
|
onKeyUp={handleKeyUp}
|
||||||
|
/>
|
||||||
|
</InputGroup>
|
||||||
|
</div>
|
||||||
|
<DropdownMenu>
|
||||||
|
<DropdownMenuTrigger asChild>
|
||||||
|
<Button size="md" variant="outline">
|
||||||
|
1 - {showData} Data
|
||||||
|
</Button>
|
||||||
|
</DropdownMenuTrigger>
|
||||||
|
<DropdownMenuContent className="w-56 text-sm">
|
||||||
|
<DropdownMenuRadioGroup
|
||||||
|
value={showData}
|
||||||
|
onValueChange={setShowData}
|
||||||
|
>
|
||||||
|
<DropdownMenuRadioItem value="10">
|
||||||
|
1 - 10 Data
|
||||||
|
</DropdownMenuRadioItem>
|
||||||
|
<DropdownMenuRadioItem value="20">
|
||||||
|
1 - 20 Data
|
||||||
|
</DropdownMenuRadioItem>
|
||||||
|
<DropdownMenuRadioItem value="25">
|
||||||
|
1 - 25 Data
|
||||||
|
</DropdownMenuRadioItem>
|
||||||
|
<DropdownMenuRadioItem value="50">
|
||||||
|
1 - 50 Data
|
||||||
|
</DropdownMenuRadioItem>
|
||||||
|
</DropdownMenuRadioGroup>
|
||||||
|
</DropdownMenuContent>
|
||||||
|
</DropdownMenu>
|
||||||
|
</div>
|
||||||
|
<Table className="overflow-hidden mt-3">
|
||||||
|
<TableHeader>
|
||||||
|
{table.getHeaderGroups().map((headerGroup) => (
|
||||||
|
<TableRow key={headerGroup.id} className="bg-default-200">
|
||||||
|
{headerGroup.headers.map((header) => (
|
||||||
|
<TableHead key={header.id}>
|
||||||
|
{header.isPlaceholder
|
||||||
|
? null
|
||||||
|
: flexRender(
|
||||||
|
header.column.columnDef.header,
|
||||||
|
header.getContext()
|
||||||
|
)}
|
||||||
|
</TableHead>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))}
|
||||||
|
</TableHeader>
|
||||||
|
<TableBody>
|
||||||
|
{table.getRowModel().rows?.length ? (
|
||||||
|
table.getRowModel().rows.map((row) => (
|
||||||
|
<TableRow
|
||||||
|
key={row.id}
|
||||||
|
data-state={row.getIsSelected() && "selected"}
|
||||||
|
className="h-[75px]"
|
||||||
|
>
|
||||||
|
{row.getVisibleCells().map((cell) => (
|
||||||
|
<TableCell key={cell.id}>
|
||||||
|
{flexRender(cell.column.columnDef.cell, cell.getContext())}
|
||||||
|
</TableCell>
|
||||||
|
))}
|
||||||
|
</TableRow>
|
||||||
|
))
|
||||||
|
) : (
|
||||||
|
<TableRow>
|
||||||
|
<TableCell colSpan={columns.length} className="h-24 text-center">
|
||||||
|
No results.
|
||||||
|
</TableCell>
|
||||||
|
</TableRow>
|
||||||
|
)}
|
||||||
|
</TableBody>
|
||||||
|
</Table>
|
||||||
|
<TablePagination
|
||||||
|
table={table}
|
||||||
|
totalData={totalData}
|
||||||
|
totalPage={totalPage}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default QuestionsTable;
|
||||||
|
|
@ -0,0 +1,136 @@
|
||||||
|
"use client";
|
||||||
|
import SiteBreadcrumb from "@/components/site-breadcrumb";
|
||||||
|
import { Link } from "@/i18n/routing";
|
||||||
|
import { Icon } from "@iconify/react/dist/iconify.js";
|
||||||
|
import QuestionsTable from "./components/questions-table";
|
||||||
|
import { useState } from "react";
|
||||||
|
|
||||||
|
interface statisticType {
|
||||||
|
incomingTotal: number;
|
||||||
|
createdTicketTotal: number;
|
||||||
|
todayIncomingTotal: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default function Questions() {
|
||||||
|
const [statisticData, setStatisticData] = useState<statisticType>({
|
||||||
|
incomingTotal: 0,
|
||||||
|
createdTicketTotal: 0,
|
||||||
|
todayIncomingTotal: 0,
|
||||||
|
});
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
<SiteBreadcrumb />
|
||||||
|
<div className="flex flex-col gap-4">
|
||||||
|
<div className="flex flex-row gap-4">
|
||||||
|
<div className="flex flex-col gap-4 w-[30%]">
|
||||||
|
<div className="flex flex-row gap-10 bg-white rounded-sm px-10 py-6 items-center">
|
||||||
|
<Icon icon="ion:ticket" width={56} />
|
||||||
|
<div className="flex flex-col gap-3">
|
||||||
|
<p className="text-3xl ">{statisticData.todayIncomingTotal}</p>
|
||||||
|
<p className="text-sm">Pertanyaan hari ini</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-row gap-10 bg-white rounded-sm px-10 py-6 items-center">
|
||||||
|
<Icon icon="ion:ticket" width={56} />
|
||||||
|
<div className="flex flex-col gap-3">
|
||||||
|
<p className="text-3xl ">{statisticData.incomingTotal}</p>
|
||||||
|
<p className="text-sm">Pertanyaan masuk</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="flex flex-row gap-10 bg-white rounded-sm px-10 py-6 items-center">
|
||||||
|
<Icon icon="ion:ticket" width={56} />
|
||||||
|
<div className="flex flex-col gap-3">
|
||||||
|
<p className="text-3xl ">{statisticData.createdTicketTotal}</p>
|
||||||
|
<p className="text-sm">Tiket dibuat</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div className="w-[70%] bg-white py-6 px-10 rounded-sm flex flex-col gap-5 text-sm">
|
||||||
|
<p>Pertanyaan masuk berdasarkan sumber:</p>
|
||||||
|
<div className="grid grid-cols-2 gap-8 text-[#2563eb]">
|
||||||
|
<Link
|
||||||
|
href="/supervisor/communications/questions/emergency"
|
||||||
|
className="flex items-center gap-3"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
icon="material-symbols:emergency-home-rounded"
|
||||||
|
width={24}
|
||||||
|
color="#2563eb"
|
||||||
|
/>
|
||||||
|
Emergency Issue
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href="/supervisor/communications/questions/email"
|
||||||
|
className="flex items-center gap-3"
|
||||||
|
>
|
||||||
|
<Icon icon="ic:baseline-email" width={22} color="#2563eb" />
|
||||||
|
Email
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href="/supervisor/communications/questions/facebook"
|
||||||
|
className="flex items-center gap-3"
|
||||||
|
>
|
||||||
|
<Icon icon="dashicons:facebook" width={24} color="#2563eb" />
|
||||||
|
Facebook
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href="/supervisor/communications/questions/x"
|
||||||
|
className="flex items-center gap-3"
|
||||||
|
>
|
||||||
|
<Icon icon="proicons:x-twitter" width={24} color="#2563eb" />X
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href="/supervisor/communications/questions/instagram"
|
||||||
|
className="flex items-center gap-3"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
icon="ant-design:instagram-filled"
|
||||||
|
width={24}
|
||||||
|
color="#2563eb"
|
||||||
|
/>
|
||||||
|
Instagram
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href="/supervisor/communications/questions/whatsapp"
|
||||||
|
className="flex items-center gap-3"
|
||||||
|
>
|
||||||
|
<Icon icon="ri:whatsapp-fill" width={24} color="#2563eb" />
|
||||||
|
Whatsapp
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href="/supervisor/communications/questions/youtube"
|
||||||
|
className="flex items-center gap-3"
|
||||||
|
>
|
||||||
|
<Icon icon="mdi:youtube" width={24} color="#2563eb" />
|
||||||
|
Youtube
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href="/supervisor/communications/questions/inbox"
|
||||||
|
className="flex items-center gap-3"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
icon="material-symbols:inbox"
|
||||||
|
width={24}
|
||||||
|
color="#2563eb"
|
||||||
|
/>
|
||||||
|
Pesan Masuk
|
||||||
|
</Link>
|
||||||
|
<Link
|
||||||
|
href="/supervisor/communications/questions/comment"
|
||||||
|
className="flex items-center gap-3"
|
||||||
|
>
|
||||||
|
<Icon
|
||||||
|
icon="material-symbols-light:comment-rounded"
|
||||||
|
width={24}
|
||||||
|
color="#2563eb"
|
||||||
|
/>
|
||||||
|
Komentar Konten
|
||||||
|
</Link>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<QuestionsTable statisticData={(data) => setStatisticData(data)} />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
@ -2176,7 +2176,7 @@ export function getMenuList(pathname: string, t: any): Group[] {
|
||||||
icon: "icon-park-outline:communication",
|
icon: "icon-park-outline:communication",
|
||||||
submenus: [
|
submenus: [
|
||||||
{
|
{
|
||||||
href: "/supervisor/communications/questions",
|
href: "/supervisor/communications/questions/all",
|
||||||
label: t("questions"),
|
label: t("questions"),
|
||||||
active: pathname.includes("/communications/questions"),
|
active: pathname.includes("/communications/questions"),
|
||||||
icon: "solar:inbox-line-outline",
|
icon: "solar:inbox-line-outline",
|
||||||
|
|
|
||||||
|
|
@ -100,3 +100,18 @@ export async function deleteCollabDiscussion(id: string | number) {
|
||||||
const url = `ticketing/collaboration/discussion?id=${id}`;
|
const url = `ticketing/collaboration/discussion?id=${id}`;
|
||||||
return httpDeleteInterceptor(url);
|
return httpDeleteInterceptor(url);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export async function getQuestionPagination(
|
||||||
|
title = "",
|
||||||
|
page: number,
|
||||||
|
typeId: string,
|
||||||
|
size: string
|
||||||
|
) {
|
||||||
|
const url = `question/pagination?enablePage=1&size=${size}&title=${title}&page=${page}&typeId=${typeId}`;
|
||||||
|
return httpGetInterceptor(url);
|
||||||
|
}
|
||||||
|
|
||||||
|
export async function deleteQuestion(id: string | number) {
|
||||||
|
const url = `/question?id=${id}`;
|
||||||
|
return httpDeleteInterceptor(url);
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue