mirror of
https://github.com/Alvin-Zilverstand/nginx-proxy-manager.git
synced 2026-11-25 15:43:14 +01:00
Use status components for true/false things
This commit is contained in:
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>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user