Files
nginx-proxy-manager/frontend/src/components/Table/Formatter/ValueWithDateFormatter.tsx
Jamie Curnow 3c252db46f
All checks were successful
Close stale issues and PRs / stale (push) Successful in 22s
Fixes #4844 with more defensive date parsing
2025-11-07 21:37:22 +10:00

22 lines
610 B
TypeScript

import { formatDateTime, T } from "src/locale";
interface Props {
value: string;
createdOn?: string;
disabled?: boolean;
}
export function ValueWithDateFormatter({ value, createdOn, disabled }: Props) {
return (
<div className="flex-fill">
<div className="font-weight-medium">
<div className={`font-weight-medium ${disabled ? "text-red" : ""}`}>{value}</div>
</div>
{createdOn ? (
<div className={`text-secondary mt-1 ${disabled ? "text-red" : ""}`}>
<T id={disabled ? "disabled" : "created-on"} data={{ date: formatDateTime(createdOn) }} />
</div>
) : null}
</div>
);
}