diff --git a/src/components/playground/SettingsDropdown.tsx b/src/components/playground/SettingsDropdown.tsx index 69484c94..4bdf37a7 100644 --- a/src/components/playground/SettingsDropdown.tsx +++ b/src/components/playground/SettingsDropdown.tsx @@ -31,7 +31,6 @@ const settingsDropdown: SettingValue[] = [ type: "outputs", key: "audio", }, - { title: "---", type: "separator", @@ -60,8 +59,9 @@ export const SettingsDropdown = () => { const isEnabled = (setting: SettingValue) => { if (setting.type === "separator" || setting.type === "theme_color") return false; + if (setting.type === "chat") { - return config.settings[setting.type]; + return config.settings.chat; } if (setting.type === "inputs") { @@ -77,6 +77,7 @@ export const SettingsDropdown = () => { const toggleSetting = (setting: SettingValue) => { if (setting.type === "separator" || setting.type === "theme_color") return; + const newValue = !isEnabled(setting); const newSettings = { ...config.settings }; @@ -87,6 +88,7 @@ export const SettingsDropdown = () => { } else if (setting.type === "outputs") { newSettings.outputs[setting.key as "video" | "audio"] = newValue; } + setUserSettings(newSettings); }; @@ -96,6 +98,7 @@ export const SettingsDropdown = () => { Settings + { } return ( - toggleSetting(setting)} + checked={isEnabled(setting)} + onSelect={(event) => { + event.preventDefault(); + toggleSetting(setting); + }} className="flex max-w-full flex-row items-end gap-2 px-3 py-2 text-xs hover:bg-gray-800 cursor-pointer" > -
- {isEnabled(setting) && } -
+ + + {setting.title} -
+ ); })}