"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;