feat: refine server management workflows

This commit is contained in:
2026-08-13 02:19:26 +07:00
parent 3a09f0b571
commit bd473863f3
22 changed files with 2069 additions and 2208 deletions
@@ -0,0 +1,55 @@
import type { ReactNode } from "react";
import { HelpTooltip } from "@/components/form-controls";
import { Checkbox } from "@/components/ui/checkbox";
import { Label } from "@/components/ui/label";
interface FieldProps {
id: string;
label: ReactNode;
tooltip?: string;
children: ReactNode;
}
export function Field({ id, label, tooltip, children }: FieldProps) {
return (
<div className="space-y-2">
<Label htmlFor={id}>
{label}
{tooltip && <HelpTooltip content={tooltip} />}
</Label>
{children}
</div>
);
}
interface CheckboxFieldProps {
id: string;
checked: boolean;
onCheckedChange: (checked: boolean) => void;
children: ReactNode;
tooltip?: string;
labelClassName?: string;
}
export function CheckboxField({
id,
checked,
onCheckedChange,
children,
tooltip,
labelClassName,
}: CheckboxFieldProps) {
return (
<div className="flex items-center space-x-2">
<Checkbox
id={id}
checked={checked}
onCheckedChange={(value) => onCheckedChange(value as boolean)}
/>
<Label htmlFor={id} className={labelClassName}>
{children}
{tooltip && <HelpTooltip content={tooltip} />}
</Label>
</div>
);
}