import { useTranslation } from "react-i18next"; import { Badge } from "@/components/ui/badge"; import { cn } from "@/lib/utils"; import { Tooltip, TooltipContent } from "../ui/tooltip"; import { TooltipTrigger } from "@radix-ui/react-tooltip"; type RuntimeOverrideIndicatorProps = { /** The value the camera is running with, which differs from the saved config. */ runtimeValue: unknown; className?: string; }; /** * Field-level companion to the section override badges. Marks a field the * running camera has drifted from, so the saved value on screen never reads as * the live one. */ export default function RuntimeOverrideIndicator({ runtimeValue, className, }: RuntimeOverrideIndicatorProps) { const { t } = useTranslation(["views/settings", "common"]); const displayValue = typeof runtimeValue === "boolean" ? t(runtimeValue ? "button.on" : "button.off", { ns: "common" }) : Array.isArray(runtimeValue) ? runtimeValue.join(", ") : String(runtimeValue); return ( {t("button.overriddenLive", { ns: "views/settings" })}

{t("button.overriddenLiveTooltip", { ns: "views/settings" })}

{t("button.overriddenLiveValue", { ns: "views/settings", value: displayValue, })}

); }