diff --git a/app/[locale]/(protected)/admin/settings/license/component/table.tsx b/app/[locale]/(protected)/admin/settings/license/component/table.tsx new file mode 100644 index 00000000..6eb621cf --- /dev/null +++ b/app/[locale]/(protected)/admin/settings/license/component/table.tsx @@ -0,0 +1,255 @@ +"use client"; + +import * as React from "react"; +import { + ColumnDef, + flexRender, + getCoreRowModel, + useReactTable, +} from "@tanstack/react-table"; + +import { + Table, + TableBody, + TableCell, + TableHead, + TableHeader, + TableRow, +} from "@/components/ui/table"; +import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; +import { useTranslations } from "next-intl"; +import { Icon } from "@iconify/react"; + +interface LicenseComponent { + id: string; + serialNumber: string; + licensor: string; + product: string; + customer: string; + capacity: string; +} + +const LicenseTable = () => { + const t = useTranslations("Menu"); + const [licenseData, setLicenseData] = React.useState([]); + + React.useEffect(() => { + // Static license data from XML file + const licenseComponents: LicenseComponent[] = [ + { + id: "1", + serialNumber: "IDC-ML-134360021025", + licensor: "SmartFace Tech Private Limited", + product: "Intelligent Digital Content", + customer: "HUMAS POLRI Indonesia", + capacity: "Unlimited" + }, + { + id: "2", + serialNumber: "ANV-ML-90370021025", + licensor: "SmartFace Tech Private Limited", + product: "Analytics and Visualization", + customer: "HUMAS POLRI Indonesia", + capacity: "Unlimited" + }, + { + id: "3", + serialNumber: "CORA-L1.1-134400021025", + licensor: "SmartFace Tech Private Limited", + product: "Content Curation", + customer: "HUMAS POLRI Indonesia", + capacity: "Unlimited" + }, + { + id: "4", + serialNumber: "TEMA-ML-134500021025", + licensor: "SmartFace Tech Private Limited", + product: "Content Management", + customer: "HUMAS POLRI Indonesia", + capacity: "Unlimited" + }, + { + id: "5", + serialNumber: "ERI-L1.1-134900021025", + licensor: "SmartFace Tech Private Limited", + product: "Emergency Issue", + customer: "HUMAS POLRI Indonesia", + capacity: "Unlimited" + }, + { + id: "6", + serialNumber: "FEC-L1.1-134800021025", + licensor: "SmartFace Tech Private Limited", + product: "Feedback Center", + customer: "HUMAS POLRI Indonesia", + capacity: "Unlimited" + }, + { + id: "7", + serialNumber: "OPTIC-L.1.1-134600021025", + licensor: "SmartFace Tech Private Limited", + product: "Optimization Content", + customer: "HUMAS POLRI Indonesia", + capacity: "Unlimited" + }, + { + id: "8", + serialNumber: "PREC-L1.1-134700021025", + licensor: "SmartFace Tech Private Limited", + product: "Press Conference", + customer: "HUMAS POLRI Indonesia", + capacity: "Unlimited" + } + ]; + + setLicenseData(licenseComponents); + }, []); + + const columns: ColumnDef[] = [ + { + accessorKey: "id", + header: "No", + cell: ({ row }) => ( +
{row.getValue("id")}
+ ), + }, + { + accessorKey: "product", + header: "Product", + cell: ({ row }) => ( +
{row.getValue("product")}
+ ), + }, + { + accessorKey: "serialNumber", + header: "Serial Number", + cell: ({ row }) => ( +
{row.getValue("serialNumber")}
+ ), + }, + { + accessorKey: "licensor", + header: "Licensor", + cell: ({ row }) =>
{row.getValue("licensor")}
, + }, + { + accessorKey: "customer", + header: "Customer", + cell: ({ row }) =>
{row.getValue("customer")}
, + }, + { + accessorKey: "capacity", + header: "Capacity", + cell: ({ row }) => ( +
+ + {row.getValue("capacity")} + +
+ ), + }, + ]; + + const table = useReactTable({ + data: licenseData, + columns, + getCoreRowModel: getCoreRowModel(), + }); + + return ( + + +
+
+ + {t("license")} Information +
+
+

+ License details for SmartFace Tech products - Valid start from 2025 +

+
+ +
+ + + {table.getHeaderGroups().map((headerGroup) => ( + + {headerGroup.headers.map((header) => ( + + {header.isPlaceholder + ? null + : flexRender( + header.column.columnDef.header, + header.getContext() + )} + + ))} + + ))} + + + {table.getRowModel().rows?.length ? ( + table.getRowModel().rows.map((row) => ( + + {row.getVisibleCells().map((cell) => ( + + {flexRender( + cell.column.columnDef.cell, + cell.getContext() + )} + + ))} + + )) + ) : ( + + + No license data available. + + + )} + +
+
+ + {licenseData.length > 0 && ( +
+
+
+ +
+

Customer

+

{licenseData[0]?.customer}

+
+
+
+ +
+

Licensor

+

{licenseData[0]?.licensor}

+
+
+
+ +
+

Total Components

+

{licenseData.length} Products Licensed

+
+
+
+
+ )} +
+
+ ); +}; + +export default LicenseTable; + diff --git a/app/[locale]/(protected)/admin/settings/license/page.tsx b/app/[locale]/(protected)/admin/settings/license/page.tsx new file mode 100644 index 00000000..41df58f4 --- /dev/null +++ b/app/[locale]/(protected)/admin/settings/license/page.tsx @@ -0,0 +1,13 @@ +"use client"; +import SiteBreadcrumb from "@/components/site-breadcrumb"; +import LicenseTable from "./component/table"; + +export default function LicensePage() { + return ( + <> + + + + ); +} + diff --git a/lib/license/licenseKey_2025.xml b/lib/license/licenseKey_2025.xml new file mode 100644 index 00000000..f9a75d62 --- /dev/null +++ b/lib/license/licenseKey_2025.xml @@ -0,0 +1,59 @@ + + + +IDC-ML-134360021025 +SmartFace Tech Private Limited +Intelligent Digital Content +HUMAS POLRI Indonesia +Unlimited + + +ANV-ML-90370021025 +SmartFace Tech Private Limited +Analytics and Visualization +HUMAS POLRI Indonesia +Unlimited + + +CORA-L1.1-134400021025 +SmartFace Tech Private Limited +Content Curation +HUMAS POLRI Indonesia +Unlimited + + +TEMA-ML-134500021025 +SmartFace Tech Private Limited +Content Management +HUMAS POLRI Indonesia +Unlimited + + +ERI-L1.1-134900021025 +SmartFace Tech Private Limited +Emergency Issue +HUMAS POLRI Indonesia +Unlimited + + +FEC-L1.1-134800021025 +SmartFace Tech Private Limited +Feedback Center +HUMAS POLRI Indonesia +Unlimited + + +OPTIC-L.1.1-134600021025 +SmartFace Tech Private Limited +Optimization Content +HUMAS POLRI Indonesia +Unlimited + + +PREC-L1.1-134700021025 +SmartFace Tech Private Limited +Press Conference +HUMAS POLRI Indonesia +Unlimited + + diff --git a/lib/menus.ts b/lib/menus.ts index 99dccd27..3e6edb5c 100644 --- a/lib/menus.ts +++ b/lib/menus.ts @@ -3888,6 +3888,13 @@ export function getMenuList(pathname: string, t: any): Group[] { icon: "heroicons:arrow-trending-up", children: [], }, + { + href: "/admin/settings/license", + label: t("license"), + active: pathname === "/admin/settings/license", + icon: "heroicons:key", + children: [], + }, // { // href: "/admin/settings/tag", // label: "Tag", diff --git a/messages/en.json b/messages/en.json index d5536714..ba2490b0 100644 --- a/messages/en.json +++ b/messages/en.json @@ -178,6 +178,7 @@ "collaboration": "Collaboration", "account-report": "Account Report", "settings": "Settings", + "license": "License", "feedback": "Feedback", "survey": "Survey", "content-production": "Content Production", diff --git a/messages/in.json b/messages/in.json index ec7a6481..0fbbf685 100644 --- a/messages/in.json +++ b/messages/in.json @@ -179,6 +179,7 @@ "collaboration": "Kolaborasi", "account-report": "Pelaporan Akun", "settings": "Pengaturan", + "license": "Lisensi", "feedback": "Feedback", "survey": "Survey", "content-production": "Produksi Konten",