import { rem, Text } from "@mantine/core"; import { IconCheck, IconPoint } from "@tabler/icons-react"; const getRequirementDisplay = (meets: boolean) => ({ true: { color: "teal", Icon: IconCheck }, false: { color: "dimmed", Icon: IconPoint }, })[String(meets) as "true" | "false"]; export function PasswordRequirement({ meets, label }: { meets: boolean; label: string }) { const display = getRequirementDisplay(meets); const Icon = display.Icon; return ( {label} ); }