2026-07-29 13:47:45 +00:00
|
|
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
|
|
|
|
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 (
|
|
|
|
|
<Card>
|
2026-08-09 23:01:51 +00:00
|
|
|
<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"
|
2026-08-09 23:01:51 +00:00
|
|
|
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' : ''}`} />
|
2026-08-09 23:01:51 +00:00
|
|
|
<span className="text-xs font-medium">Refresh</span>
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
2026-08-09 23:01:51 +00:00
|
|
|
className="flex h-auto flex-col items-center gap-1.5 px-2 py-3"
|
2026-07-29 19:35:37 +00:00
|
|
|
onClick={() => onNavigate?.('dashboard')}
|
2026-07-29 13:47:45 +00:00
|
|
|
>
|
|
|
|
|
<Server className="h-4 w-4" />
|
2026-08-09 23:01:51 +00:00
|
|
|
<span className="text-xs font-medium">Nodes</span>
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
2026-08-09 23:01:51 +00:00
|
|
|
className="flex h-auto flex-col items-center gap-1.5 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-09 23:01:51 +00:00
|
|
|
<span className="text-xs font-medium">VMs</span>
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
2026-08-09 23:01:51 +00:00
|
|
|
className="flex h-auto flex-col items-center gap-1.5 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-09 23:01:51 +00:00
|
|
|
<span className="text-xs font-medium">Storage</span>
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
2026-08-09 23:01:51 +00:00
|
|
|
className="flex h-auto flex-col items-center gap-1.5 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-09 23:01:51 +00:00
|
|
|
<span className="text-xs font-medium">Tasks</span>
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
<Button
|
|
|
|
|
variant="outline"
|
2026-08-09 23:01:51 +00:00
|
|
|
className="flex h-auto flex-col items-center gap-1.5 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-09 23:01:51 +00:00
|
|
|
<span className="text-xs font-medium">Backups</span>
|
2026-07-29 13:47:45 +00:00
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
)
|
|
|
|
|
}
|