mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat: add toggle for auto updates checking
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
import { Label } from "@/components/ui/label";
|
||||
import { Switch } from "@/components/ui/switch";
|
||||
import { useState } from "react";
|
||||
|
||||
export const ToggleAutoCheckUpdates = () => {
|
||||
const [enabled, setEnabled] = useState<boolean>(
|
||||
localStorage.getItem("enableAutoCheckUpdates") === "true",
|
||||
);
|
||||
|
||||
const handleToggle = async (checked: boolean) => {
|
||||
setEnabled(checked);
|
||||
localStorage.setItem("enableAutoCheckUpdates", String(checked));
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="flex items-center gap-4">
|
||||
<Switch
|
||||
checked={enabled}
|
||||
onCheckedChange={handleToggle}
|
||||
id="autoCheckUpdatesToggle"
|
||||
/>
|
||||
<Label className="text-primary" htmlFor="autoCheckUpdatesToggle">
|
||||
Automatically check for new updates
|
||||
</Label>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user