Files
nginx-proxy-manager/frontend/src/components/Table/Formatter/ValueWithDateFormatter.tsx
2025-10-02 23:06:51 +10:00

22 lines
610 B
TypeScript

import { DateTimeFormat, 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: DateTimeFormat(createdOn) }} />
</div>
) : null}
</div>
);
}