1
0
mirror of https://github.com/NginxProxyManager/nginx-proxy-manager.git synced 2025-11-01 05:31:05 +03:00

Wrap intl in span identifying translation

This commit is contained in:
Jamie Curnow
2025-10-02 23:06:51 +10:00
parent fcb08d3003
commit 227e818040
68 changed files with 1076 additions and 510 deletions

View File

@@ -1,10 +1,6 @@
import { IconArrowsCross, IconBolt, IconBoltOff, IconDisc, IconUser } from "@tabler/icons-react";
import type { AuditLog } from "src/api/backend";
import { DateTimeFormat, intl } from "src/locale";
const getEventTitle = (event: AuditLog) => (
<span>{intl.formatMessage({ id: `event.${event.action}-${event.objectType}` })}</span>
);
import { DateTimeFormat, T } from "src/locale";
const getEventValue = (event: AuditLog) => {
switch (event.objectType) {
@@ -63,7 +59,9 @@ export function EventFormatter({ row }: Props) {
return (
<div className="flex-fill">
<div className="font-weight-medium">
{getIcon(row)} {getEventTitle(row)} &mdash; <span className="badge">{getEventValue(row)}</span>
{getIcon(row)}
<T id={`event.${row.action}-${row.objectType}`} />
&mdash; <span className="badge">{getEventValue(row)}</span>
</div>
<div className="text-secondary mt-1">{DateTimeFormat(row.createdOn)}</div>
</div>