"use client"; import { cn } from "../../../lib/utils"; import { CheckIcon, MinusIcon, XIcon } from "lucide-react"; import { Badge, Tooltip, TooltipContent, TooltipTrigger } from "../../../shadcnui"; import { PermissionValue } from "../data/RbacTypes"; interface RbacPermissionCellProps { value: PermissionValue | undefined | null; originalValue?: PermissionValue | undefined | null; isRoleColumn?: boolean; onClick?: () => void; } export default function RbacPermissionCell({ value, originalValue, isRoleColumn = false, onClick, }: RbacPermissionCellProps) { const isDirty = originalValue !== undefined && value !== originalValue; // null or undefined in role column = inherit from default (show dash) if (isRoleColumn && (value === null || value === undefined)) { return (
); } if (value === true) { return (
true
); } if (value === false) { return (
false
); } // String value (relationship path) const displayValue = typeof value === "string" ? value : String(value); const truncated = displayValue.length > 20 ? displayValue.substring(0, 18) + "..." : displayValue; return ( } > {truncated}

{displayValue}

); } export { RbacPermissionCell };