Files
clustri/src/components/dashboard/QuickActions.tsx
T

79 lines
3.3 KiB
TypeScript
Raw Normal View History

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'
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
onNavigate?: (view: string) => void
2026-07-29 13:47:45 +00:00
}
export function QuickActions({ onRefresh, isRefreshing, onNavigate }: QuickActionsProps) {
2026-07-29 13:47:45 +00:00
return (
<Card className="dot-grid">
<CardHeader className="flex flex-row items-center justify-between space-y-0 border-b border-dotted border-border/60">
<div className="flex items-center gap-2.5">
<div className="flex h-7 w-7 items-center justify-center rounded-sm border border-dotted border-border bg-muted/40">
<Zap className="h-3.5 w-3.5 text-muted-foreground" />
</div>
<DotMatrixText text="QUICK ACTIONS" size="xs" className="text-foreground" />
</div>
2026-07-29 13:47:45 +00:00
</CardHeader>
<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"
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' : ''}`} />
<DotMatrixText text="REFRESH" size="xs" className="text-muted-foreground" />
2026-07-29 13:47:45 +00:00
</Button>
<Button
variant="outline"
className="flex h-auto flex-col items-center gap-1.5 border-dotted px-2 py-3"
onClick={() => onNavigate?.('nodes')}
2026-07-29 13:47:45 +00:00
>
<Server className="h-4 w-4" />
<DotMatrixText text="NODES" size="xs" className="text-muted-foreground" />
2026-07-29 13:47:45 +00:00
</Button>
<Button
variant="outline"
className="flex h-auto flex-col items-center gap-1.5 border-dotted px-2 py-3"
onClick={() => onNavigate?.('vms')}
2026-07-29 13:47:45 +00:00
>
<Box className="h-4 w-4" />
<DotMatrixText text="VMS" size="xs" className="text-muted-foreground" />
2026-07-29 13:47:45 +00:00
</Button>
<Button
variant="outline"
className="flex h-auto flex-col items-center gap-1.5 border-dotted px-2 py-3"
onClick={() => onNavigate?.('storage')}
2026-07-29 13:47:45 +00:00
>
<HardDrive className="h-4 w-4" />
<DotMatrixText text="STORAGE" size="xs" className="text-muted-foreground" />
2026-07-29 13:47:45 +00:00
</Button>
<Button
variant="outline"
className="flex h-auto flex-col items-center gap-1.5 border-dotted px-2 py-3"
onClick={() => onNavigate?.('tasks')}
2026-07-29 13:47:45 +00:00
>
<ListTodo className="h-4 w-4" />
<DotMatrixText text="TASKS" size="xs" className="text-muted-foreground" />
2026-07-29 13:47:45 +00:00
</Button>
<Button
variant="outline"
className="flex h-auto flex-col items-center gap-1.5 border-dotted px-2 py-3"
onClick={() => onNavigate?.('backups')}
2026-07-29 13:47:45 +00:00
>
<Shield className="h-4 w-4" />
<DotMatrixText text="BACKUPS" size="xs" className="text-muted-foreground" />
2026-07-29 13:47:45 +00:00
</Button>
</div>
</CardContent>
</Card>
)
}