mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-09-30 16:44:57 +01:00
25 lines
538 B
TypeScript
25 lines
538 B
TypeScript
import cn from "classnames";
|
|
import { T } from "src/locale";
|
|
|
|
interface Props {
|
|
value: boolean;
|
|
trueLabel?: string;
|
|
trueColor?: string;
|
|
falseLabel?: string;
|
|
falseColor?: string;
|
|
}
|
|
export function TrueFalseFormatter({
|
|
value,
|
|
trueLabel = "enabled",
|
|
trueColor = "lime",
|
|
falseLabel = "disabled",
|
|
falseColor = "red",
|
|
}: Props) {
|
|
return (
|
|
<span className={cn("status", `status-${value ? trueColor : falseColor}`)}>
|
|
<span className="status-dot status-dot-animated" />
|
|
<T id={value ? trueLabel : falseLabel} />
|
|
</span>
|
|
);
|
|
}
|