import React from "react"; import { Body } from "./Primitives/Body"; import { usePreferences } from "~/components/PreferencesProvider"; const MIN_INDENT = 1; const MAX_INDENT = 8; export function IndentPreference() { const [preferences, setPreferences] = usePreferences(); const updatePreferences = (e: React.ChangeEvent) => { let newIdent = Number(e.target.value); if (newIdent < MIN_INDENT) newIdent = MIN_INDENT; if (newIdent > MAX_INDENT) newIdent = MAX_INDENT; e.target.value = newIdent.toString(); setPreferences({ ...preferences, indent: newIdent }); }; return (
); }