import { customWidthAtom, useCustomWidthAtom } from "@/atoms/userSettingsAtom"; import { useAtom, useAtomValue } from "jotai"; import React from "react"; import { translationAtom } from "@/atoms/translations-atom"; export function CustomResolutionInput() { const [useCustomWidth, setUseCustomWidth] = useAtom(useCustomWidthAtom); const [customWidth, setCustomWidth] = useAtom(customWidthAtom); const t = useAtomValue(translationAtom); return (

{t("APP.INFOS.CUSTOM_INPUT_RESOLUTION.WIDTH")}

{t("APP.INFOS.CUSTOM_INPUT_RESOLUTION.RESTART")}
{t("APP.INFOS.CUSTOM_INPUT_RESOLUTION.CUSTOM_WIDTH_TIP")}

{ if (!e.currentTarget.checked) { localStorage.removeItem("customWidth"); } setUseCustomWidth(!useCustomWidth); }} /> { if (e.currentTarget.value === "") { setUseCustomWidth(false); setCustomWidth(null); localStorage.removeItem("customWidth"); return; } setCustomWidth(parseInt(e.currentTarget.value)); }} step="1" min="1" className="input input-primary h-7 w-32 [appearance:textfield] [&::-webkit-inner-spin-button]:appearance-none [&::-webkit-outer-spin-button]:appearance-none" />
); }