'use client'; import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; import { Badge } from '@/components/ui/badge'; import { Label } from '@/components/ui/label'; import { Smartphone, Info, HardDrive, Shield, Wifi, XCircle, Battery, CheckCircle, AlertCircle } from 'lucide-react'; import { AddigyDevice } from '@/lib/types/addigy'; interface AddigyTabProps { device?: AddigyDevice; } export function AddigyTab({ device }: AddigyTabProps) { if (!device) { return (

No Addigy data available for this device

); } const isOnline = device.online; const batteryPercentage = device['Battery Percentage']; const isCharging = device['Battery Charging']; const freeSpacePercentage = device['Free Disk Percentage']; return ( Addigy Device Information (Apple RMM)
{/* Basic Information */}

Basic Information

{device['Device Name']}

{device['Device Model Name'] || '-'}

{device['Serial Number'] || '-'}

{device['Current User'] || '-'}

{isOnline ? ( Online ) : ( Offline )}
{device['Last Check In'] && (

{new Date(device['Last Check In']).toLocaleString()}

)}
{/* System Information */}

System Information

{device['MAC OS X Version'] || device['iOS Version'] || '-'}

{device['Processor Type'] && (

{device['Processor Type']} {device['Processor Speed (GHz)'] && ` @ ${device['Processor Speed (GHz)']} GHz`}

)} {device['Total Disk Space (GB)'] && (

{device['Free Disk Space (GB)']} GB free of {device['Total Disk Space (GB)']} GB

{freeSpacePercentage !== undefined && (
{freeSpacePercentage.toFixed(1)}%
)}
)} {batteryPercentage !== undefined && (
{batteryPercentage}% {isCharging && ' (Charging)'} {device['Battery Capacity Loss Percentage'] !== undefined && ( ({device['Battery Capacity Loss Percentage']}% capacity loss) )}
)}

{device['Agent Version'] || '-'}

{device.Timezone && (

{device.Timezone}

)}
{/* Security & Features */}

Security & Features

{device['Firewall Enabled'] ? ( Enabled ) : ( Disabled )}
{device['FileVault Enabled'] ? ( Enabled ) : ( Disabled )}
{device['Remote Login Enabled'] !== undefined && (
{device['Remote Login Enabled'] ? ( Enabled ) : ( Disabled )}
)} {device['SMART Failing'] !== undefined && (
{device['SMART Failing'] ? ( Failing ) : ( Healthy )}
)} {device['Has Wireless'] !== undefined && (

{device['Has Wireless'] ? 'Yes' : 'No'}

)} {device['XCode Installed'] !== undefined && (

{device['XCode Installed'] ? 'Installed' : 'Not Installed'}

)}
{/* Additional Information */}

Additional Information

{device.agentid}

{device.policy_id}

{device['Warranty Expiration Date'] && (

Expires: {new Date(device['Warranty Expiration Date']).toLocaleDateString()} {device['Warranty Days Left'] !== undefined && ( ({device['Warranty Days Left']} days left) )}

)} {device['TeamViewer Client Id'] && (

{device['TeamViewer Client Id']}

)} {device['Displays Serial Number'] && device['Displays Serial Number'].length > 0 && (
{device['Displays Serial Number'].map((serial, idx) => (
{serial}
))}
)}
); }