export const setting = (key: string) => { return { get: () => { const value = localStorage.getItem(key); return value !== null ? (JSON.parse(value) as T) : undefined; }, set: (value: T | undefined) => value === undefined ? localStorage.removeItem(key) : localStorage.setItem(key, JSON.stringify(value)), }; }; export type Setting = ReturnType>; export const showVisualizer = setting("showVisualizer"); export const showProfilePicture = setting("showProfilePicture"); export const useDominantColorAsBg = setting("useDominantColorAsBg"); export const backgroundColor = setting("backgroundColor"); export const frameRate = setting("frameRate"); export const autoTranscribe = setting("autoTranscribe"); export const whisperModel = setting("whisperModel"); export const defaultWhisperModel = "onnx-community/whisper-tiny";