add admin/license i18n

This commit is contained in:
Lokowitz
2025-05-06 09:41:44 +00:00
parent 4dd9f4736d
commit 1e72b0f854
4 changed files with 124 additions and 98 deletions

View File

@@ -13,6 +13,7 @@ import { LicenseKeyCache } from "@server/license/license";
import { ArrowUpDown } from "lucide-react";
import moment from "moment";
import CopyToClipboard from "@app/components/CopyToClipboard";
import { useTranslations } from 'next-intl';
type LicenseKeysDataTableProps = {
licenseKeys: LicenseKeyCache[];
@@ -32,6 +33,9 @@ export function LicenseKeysDataTable({
onDelete,
onCreate
}: LicenseKeysDataTableProps) {
const t = useTranslations();
const columns: ColumnDef<LicenseKeyCache>[] = [
{
accessorKey: "licenseKey",
@@ -43,7 +47,7 @@ export function LicenseKeysDataTable({
column.toggleSorting(column.getIsSorted() === "asc")
}
>
License Key
{t('licenseKey')}
<ArrowUpDown className="ml-2 h-4 w-4" />
</Button>
);
@@ -68,7 +72,7 @@ export function LicenseKeysDataTable({
column.toggleSorting(column.getIsSorted() === "asc")
}
>
Valid
{t('valid')}
<ArrowUpDown className="ml-2 h-4 w-4" />
</Button>
);
@@ -87,7 +91,7 @@ export function LicenseKeysDataTable({
column.toggleSorting(column.getIsSorted() === "asc")
}
>
Type
{t('type')}
<ArrowUpDown className="ml-2 h-4 w-4" />
</Button>
);
@@ -112,7 +116,7 @@ export function LicenseKeysDataTable({
column.toggleSorting(column.getIsSorted() === "asc")
}
>
Number of Sites
{t('numberOfSites')}
<ArrowUpDown className="ml-2 h-4 w-4" />
</Button>
);
@@ -126,7 +130,7 @@ export function LicenseKeysDataTable({
variant="outlinePrimary"
onClick={() => onDelete(row.original)}
>
Delete
{t('delete')}
</Button>
</div>
)
@@ -138,10 +142,10 @@ export function LicenseKeysDataTable({
columns={columns}
data={licenseKeys}
title="License Keys"
searchPlaceholder="Search license keys..."
searchPlaceholder={t('licenseKeySearch')}
searchColumn="licenseKey"
onAdd={onCreate}
addButtonText="Add License Key"
addButtonText={t('licenseKeyAdd')}
/>
);
}