'use client' import type { MacMiniStatus } from '../types' export default function PowerControls({ status, loading, actionLoading, message, error, onWake, onRestart, onShutdown, onRefresh, }: { status: MacMiniStatus | null loading: boolean actionLoading: string | null message: string | null error: string | null onWake: () => void onRestart: () => void onShutdown: () => void onRefresh: () => void }) { const getStatusBadge = (online: boolean) => { return online ? 'px-3 py-1 rounded-full text-sm font-semibold bg-green-100 text-green-800' : 'px-3 py-1 rounded-full text-sm font-semibold bg-red-100 text-red-800' } const getServiceStatus = (ok: boolean) => { return ok ? 'flex items-center gap-2 text-green-600' : 'flex items-center gap-2 text-red-500' } return (
🖥️

Mac Mini Headless

IP: {status?.ip || '192.168.178.100'}

{loading ? 'Laden...' : status?.online ? 'Online' : 'Offline'}
{/* Power Buttons */}
{message && {message}} {error && {error}}
{/* Service Status Grid */}
Ping
{status?.ping ? 'Erreichbar' : 'Nicht erreichbar'}
SSH
{status?.ssh ? 'Verbunden' : 'Getrennt'}
Docker
{status?.docker ? 'Aktiv' : 'Inaktiv'}
Ollama
{status?.ollama ? 'Bereit' : 'Nicht bereit'}
Uptime
{status?.uptime || '-'}
) }