Use status components for true/false things

This commit is contained in:
Jamie Curnow committed 2025-10-28 14:18:52 +10:00
1 parent fac5f2cbc5
commit 0f718570d6
12 files changed
+60 -53

No files matched your search

@@ -0,0 +1,24 @@
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>
);
}