import { TFunction, t as i18nT } from "i18next"; import { useTranslation } from "react-i18next"; import { Colors } from "~/application/enums/shared/Colors"; import SimpleBadge from "~/components/ui/badges/SimpleBadge"; import CheckIcon from "~/components/ui/icons/CheckIcon"; import XIcon from "~/components/ui/icons/XIcon"; import { BooleanFormatType } from "~/utils/shared/BooleanUtils"; export function getBooleanAsStringValue({ value, format, t }: { value?: boolean; format?: BooleanFormatType; t?: TFunction }) { const translate = t ?? i18nT; return !format || format === "yesNo" ? value ? translate("shared.yes") : translate("shared.no") : format === "trueFalse" ? value ? translate("shared.true") : translate("shared.false") : format === "enabledDisabled" ? value ? translate("shared.enabled") : translate("shared.disabled") : format === "onOff" ? value ? translate("shared.on") : translate("shared.off") : format === "activeInactive" ? value ? translate("shared.active") : translate("shared.inactive") : ""; } export default function RowBooleanCell({ value, format }: { value?: boolean; format?: BooleanFormatType }) { const { t } = useTranslation(); return ( <> {!format ? (
{value ? : }
) : ( )} ); }