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

78 lines
2.9 KiB
TypeScript
Raw Normal View History

2026-07-29 13:47:45 +00:00
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
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>
<CardHeader className="flex flex-row items-center justify-between space-y-0">
<div className="flex items-center gap-2.5">
<div className="flex h-7 w-7 items-center justify-center rounded-md border border-border bg-muted/40">
<Zap className="h-3.5 w-3.5 text-muted-foreground" />
</div>
<CardTitle className="text-sm font-semibold">Quick Actions</CardTitle>
</div>
2026-07-29 13:47:45 +00:00
</CardHeader>
<CardContent>
<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 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' : ''}`} />
<span className="text-xs font-medium">Refresh</span>
2026-07-29 13:47:45 +00:00
</Button>
<Button
variant="outline"
className="flex h-auto flex-col items-center gap-1.5 px-2 py-3"
onClick={() => onNavigate?.('dashboard')}
2026-07-29 13:47:45 +00:00
>
<Server className="h-4 w-4" />
<span className="text-xs font-medium">Nodes</span>
2026-07-29 13:47:45 +00:00
</Button>
<Button
variant="outline"
className="flex h-auto flex-col items-center gap-1.5 px-2 py-3"
onClick={() => onNavigate?.('vms')}
2026-07-29 13:47:45 +00:00
>
<Box className="h-4 w-4" />
<span className="text-xs font-medium">VMs</span>
2026-07-29 13:47:45 +00:00
</Button>
<Button
variant="outline"
className="flex h-auto flex-col items-center gap-1.5 px-2 py-3"
onClick={() => onNavigate?.('storage')}
2026-07-29 13:47:45 +00:00
>
<HardDrive className="h-4 w-4" />
<span className="text-xs font-medium">Storage</span>
2026-07-29 13:47:45 +00:00
</Button>
<Button
variant="outline"
className="flex h-auto flex-col items-center gap-1.5 px-2 py-3"
onClick={() => onNavigate?.('tasks')}
2026-07-29 13:47:45 +00:00
>
<ListTodo className="h-4 w-4" />
<span className="text-xs font-medium">Tasks</span>
2026-07-29 13:47:45 +00:00
</Button>
<Button
variant="outline"
className="flex h-auto flex-col items-center gap-1.5 px-2 py-3"
onClick={() => onNavigate?.('backups')}
2026-07-29 13:47:45 +00:00
>
<Shield className="h-4 w-4" />
<span className="text-xs font-medium">Backups</span>
2026-07-29 13:47:45 +00:00
</Button>
</div>
</CardContent>
</Card>
)
}