import React from 'react' import { cn } from '../../utils/cn' export interface DeviceCardCompactProps extends React.HTMLAttributes { deviceName?: string | null organization?: string | null } /** * Compact device card variant for table cells * Shows only device name and organization in a stacked layout * Returns empty fragment if both values are missing */ export function DeviceCardCompact({ deviceName, organization, className, ...props }: DeviceCardCompactProps) { // Check for valid values (not null, undefined, '-', or string 'null') const hasName = deviceName && deviceName !== '-' && deviceName !== 'null' const hasOrg = organization && organization !== '-' && organization !== 'null' // If both are missing, return empty fragment if (!hasName && !hasOrg) { return <> } return (
{hasName && ( {deviceName} )} {hasOrg && ( {organization} )}
) }