import { AuvikDevice } from '@/lib/types/auvik'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Label } from '@/components/ui/label'; import { Network, Info, Wifi, XCircle, AlertCircle } from 'lucide-react'; interface AuvikTabProps { device?: AuvikDevice; } export function AuvikTab({ device }: AuvikTabProps) { if (!device) { return (

No Auvik data available

This device is not monitored by Auvik or could not be matched to an Auvik device.

); } const formatDate = (dateString?: string) => { if (!dateString) return 'N/A'; return new Date(dateString).toLocaleString(); }; const getStatusBadge = () => { switch (device.onlineStatus) { case 'online': return ( Online ); case 'offline': return ( Offline ); default: return ( Unknown ); } }; return (
{/* Status Header */}

{device.deviceName}

{getStatusBadge()}
{/* Basic Information */} Basic Information

{device.deviceName || 'N/A'}

{device.deviceType || 'N/A'}

{device.serialNumber || 'N/A'}

{device.manufacturer || device.vendorName || 'N/A'}

{device.model || device.makeModel || 'N/A'}

{/* Network Information */} Network Information
{device.ipAddresses && device.ipAddresses.length > 0 ? (
{device.ipAddresses.map((ip, index) => ( {ip} ))}
) : (

N/A

)}
{device.macAddresses && device.macAddresses.length > 0 ? (
{device.macAddresses.map((mac, index) => ( {mac} ))}
) : (

N/A

)}

{device.tenantName || 'N/A'}

{/* Status Information */} Status Information
{getStatusBadge()}

{formatDate(device.lastSeenTime)}

{/* Firmware Information */} Firmware Information

{device.firmwareVersion || 'N/A'}

{device.softwareVersion || 'N/A'}

{/* Description */} {device.description && ( Description

{device.description}

)} {/* Network Interfaces */} {device.networkInterfaces && device.networkInterfaces.length > 0 && ( Network Interfaces
{device.networkInterfaces.map((iface, index) => (

{iface.interfaceName}

{iface.macAddress && (

{iface.macAddress}

)}
{iface.ipAddress && ( {iface.ipAddress} )} {iface.status}
))}
)}
); }