2026-08-25 13:08:21 +00:00
|
|
|
import { Card, CardContent, CardHeader } from '@/components/ui/card'
|
|
|
|
|
import { DotMatrixText } from '@/components/ui/dot-matrix'
|
2026-07-29 13:47:45 +00:00
|
|
|
import { Button } from '@/components/ui/button'
|
2026-08-09 23:01:51 +00:00
|
|
|
import { RefreshCw, Server, Box, HardDrive, ListTodo, Shield, Zap } from 'lucide-react'
|
2026-07-29 13:47:45 +00:00
|
|
|
|
|
|
|
|
interface QuickActionsProps {
|
|
|
|
|
onRefresh: () => void
|
|
|
|
|
isRefreshing: boolean
|
2026-07-29 19:35:37 +00:00
|
|
|
onNavigate?: (view: string) => void
|
2026-07-29 13:47:45 +00:00
|
|
|
}
|
|
|
|
|
|
2026-07-29 19:35:37 +00:00
|
|
|
export function QuickActions({ onRefresh, isRefreshing, onNavigate }: QuickActionsProps) {
|
2026-07-29 13:47:45 +00:00
|
|
|
return (
|
2026-08-25 13:08:21 +00:00
|
|
|
<Card className="dot-grid">
|
|
|
|
|
<CardHeader className="flex flex-row items-center justify-between space-y-0 border-b border-dotted border-border/60">
|
2026-08-09 23:01:51 +00:00
|
|
|
<div className="flex items-center gap-2.5">
|
2026-08-25 13:08:21 +00:00
|
|
|
<div className="flex h-7 w-7 items-center justify-center rounded-sm border border-dotted border-border bg-muted/40">
|
2026-08-09 23:01:51 +00:00
|
|
|
<Zap className="h-3.5 w-3.5 text-muted-foreground" />
|
|
|
|
|
</div>
|
2026-08-25 13:08:21 +00:00
|
|
|
<DotMatrixText text="QUICK ACTIONS" size="xs" className="text-foreground" />
|
2026-08-09 23:01:51 +00:00
|
|
|
</div>
|
2026-07-29 13:47:45 +00:00
|
|
|
</CardHeader>
|
2026-08-25 13:08:21 +00:00
|
|
|
<CardContent className="pt-4">
|
2026-07-29 13:47:45 +00:00
|
|
|
<div className="grid grid-cols-2 sm:grid-cols-3 gap-2">
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
2026-08-25 13:08:21 +00:00
|
|
|
className="flex h-auto flex-col items-center gap-1.5 border-dotted px-2 py-3"
|
2026-07-29 13:47:45 +00:00
|
|
|
onClick={onRefresh}
|
|
|
|
|
disabled={isRefreshing}
|
|
|
|
|
>
|
|
|
|
|
<RefreshCw className={`h-4 w-4 ${isRefreshing ? 'animate-spin' : ''}`} />
|
2026-08-25 13:08:21 +00:00
|
|
|
<DotMatrixText text="REFRESH" size="xs" className="text-muted-foreground" />
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
2026-08-25 13:08:21 +00:00
|
|
|
className="flex h-auto flex-col items-center gap-1.5 border-dotted px-2 py-3"
|
2026-08-10 14:33:06 +00:00
|
|
|
onClick={() => onNavigate?.('nodes')}
|
2026-07-29 13:47:45 +00:00
|
|
|
>
|
|
|
|
|
<Server className="h-4 w-4" />
|
2026-08-25 13:08:21 +00:00
|
|
|
<DotMatrixText text="NODES" size="xs" className="text-muted-foreground" />
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
2026-08-25 13:08:21 +00:00
|
|
|
className="flex h-auto flex-col items-center gap-1.5 border-dotted px-2 py-3"
|
2026-07-29 19:35:37 +00:00
|
|
|
onClick={() => onNavigate?.('vms')}
|
2026-07-29 13:47:45 +00:00
|
|
|
>
|
|
|
|
|
<Box className="h-4 w-4" />
|
2026-08-25 13:08:21 +00:00
|
|
|
<DotMatrixText text="VMS" size="xs" className="text-muted-foreground" />
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
2026-08-25 13:08:21 +00:00
|
|
|
className="flex h-auto flex-col items-center gap-1.5 border-dotted px-2 py-3"
|
2026-07-29 19:35:37 +00:00
|
|
|
onClick={() => onNavigate?.('storage')}
|
2026-07-29 13:47:45 +00:00
|
|
|
>
|
|
|
|
|
<HardDrive className="h-4 w-4" />
|
2026-08-25 13:08:21 +00:00
|
|
|
<DotMatrixText text="STORAGE" size="xs" className="text-muted-foreground" />
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
2026-08-25 13:08:21 +00:00
|
|
|
className="flex h-auto flex-col items-center gap-1.5 border-dotted px-2 py-3"
|
2026-07-29 19:35:37 +00:00
|
|
|
onClick={() => onNavigate?.('tasks')}
|
2026-07-29 13:47:45 +00:00
|
|
|
>
|
|
|
|
|
<ListTodo className="h-4 w-4" />
|
2026-08-25 13:08:21 +00:00
|
|
|
<DotMatrixText text="TASKS" size="xs" className="text-muted-foreground" />
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
2026-08-25 13:08:21 +00:00
|
|
|
className="flex h-auto flex-col items-center gap-1.5 border-dotted px-2 py-3"
|
2026-07-29 19:35:37 +00:00
|
|
|
onClick={() => onNavigate?.('backups')}
|
2026-07-29 13:47:45 +00:00
|
|
|
>
|
|
|
|
|
<Shield className="h-4 w-4" />
|
2026-08-25 13:08:21 +00:00
|
|
|
<DotMatrixText text="BACKUPS" size="xs" className="text-muted-foreground" />
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
)
|
|
|
|
|
}
|