This commit is contained in:
Saeed Vaziry
2025-05-30 11:02:07 +02:00
parent 1b9f826bcb
commit 104cd2fce8
14 changed files with 572 additions and 266 deletions

View File

@ -77,11 +77,15 @@ function Action({ type, worker }: { type: 'start' | 'stop' | 'restart'; worker:
return (
<Dialog open={open} onOpenChange={setOpen}>
<DialogTrigger asChild>
<DropdownMenuItem onSelect={(e) => e.preventDefault()}>{type}</DropdownMenuItem>
<DropdownMenuItem onSelect={(e) => e.preventDefault()} className="capitalize">
{type}
</DropdownMenuItem>
</DialogTrigger>
<DialogContent>
<DialogHeader>
<DialogTitle>{type} worker</DialogTitle>
<DialogTitle>
<span className="capitalize">{type}</span> worker
</DialogTitle>
<DialogDescription className="sr-only">{type} worker</DialogDescription>
</DialogHeader>
<p className="p-4">Are you sure you want to {type} the worker?</p>
@ -89,7 +93,7 @@ function Action({ type, worker }: { type: 'start' | 'stop' | 'restart'; worker:
<DialogClose asChild>
<Button variant="outline">Cancel</Button>
</DialogClose>
<Button disabled={form.processing} onClick={submit}>
<Button variant={['stop'].includes(type) ? 'destructive' : 'default'} disabled={form.processing} onClick={submit} className="capitalize">
{form.processing && <LoaderCircleIcon className="animate-spin" />}
<FormSuccessful successful={form.recentlySuccessful} />
{type}