import {Bell, Copy} from "lucide-react"; import { Label } from "@/components/ui/label"; import { Checkbox } from "@/components/ui/checkbox"; import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue, } from "@/components/ui/select"; import { Input } from "@/components/ui/input"; import { Button } from "@/components/ui/button"; import React, { type FormEvent } from "react"; import { useSettings } from "@/hooks/use-settings"; import { useTelegramAccount } from "@/hooks/use-telegram-account"; import {useCopyToClipboard} from "@/hooks/use-copy-to-clipboard"; export default function SettingsForm() { const { settings, setSetting, updateSettings } = useSettings(); const { account } = useTelegramAccount(); const [, copyToClipboard] = useCopyToClipboard(); const imageLoadSizeOptions = [ { value: "s", label: "box 100x100" }, { value: "m", label: "box 320x320" }, { value: "x", label: "box 800x800" }, { value: "y", label: "box 1280x1280" }, { value: "w", label: "box 2560x2560" }, { value: "a", label: "crop 160x160" }, { value: "b", label: "crop 320x320" }, { value: "c", label: "crop 640x640" }, { value: "d", label: "crop 1280x1280" }, ]; const avgSpeedIntervalOptions = [ { value: "60", label: "1 minute" }, { value: "300", label: "5 minutes" }, { value: "600", label: "10 minutes" }, { value: "900", label: "15 minutes" }, { value: "1800", label: "30 minutes" }, ]; const handleSave = async (e: FormEvent) => { e.preventDefault(); await updateSettings(); }; return (

These settings will be applied to all accounts.

Your root path

{account?.rootPath}

void setSetting("uniqueOnly", String(checked)) } />

Show only unique file in the table. If disabled, will show all.{" "}
Warning: If enabled, the number of documents on the form will be inaccurate.

{ void setSetting("needToLoadImages", String(checked)); }} />
{settings?.needToLoadImages === "true" && (

The size of the image to load in the browser.

)}
void setSetting("alwaysHide", String(checked)) } />

Always hide content and extra info in the table.

{settings?.alwaysHide === "false" && ( <>
void setSetting("showSensitiveContent", String(checked)) } />

Show sensitive content in the table, Will use a spoiler to hide sensitive content if disabled.

)}
{ void setSetting("autoDownloadLimit", e.target.value); }} />

The interval to calculate the average download speed.
Longer intervals may consume more memory.

); }