From ca74a157ca5cc22c9b4292c895af35be96b54588 Mon Sep 17 00:00:00 2001 From: xXJSONDeruloXx Date: Sat, 16 Aug 2025 15:35:49 -0400 Subject: move new profile into dropdown --- src/components/ProfileManagement.tsx | 34 +++++++++++++++++++--------------- 1 file changed, 19 insertions(+), 15 deletions(-) (limited to 'src') diff --git a/src/components/ProfileManagement.tsx b/src/components/ProfileManagement.tsx index 709a28c..ef68844 100644 --- a/src/components/ProfileManagement.tsx +++ b/src/components/ProfileManagement.tsx @@ -216,6 +216,14 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa } }; + const handleDropdownChange = (option: DropdownOption) => { + if (option.data === "__NEW_PROFILE__") { + handleCreateProfile(); + } else { + handleProfileChange(option.data); + } + }; + const handleRenameProfile = () => { if (selectedProfile === "decky-lsfg-vk") { showErrorToast("Cannot rename default profile", "The default profile cannot be renamed"); @@ -259,10 +267,16 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa } }; - const profileOptions: DropdownOption[] = profiles.map(profile => ({ - data: profile, - label: profile === "decky-lsfg-vk" ? `${profile} (default)` : profile - })); + const profileOptions: DropdownOption[] = [ + ...profiles.map((profile: string) => ({ + data: profile, + label: profile === "decky-lsfg-vk" ? "Default" : profile + })), + { + data: "__NEW_PROFILE__", + label: "New Profile" + } + ]; return ( @@ -275,21 +289,11 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa handleProfileChange(option.data)} + onChange={handleDropdownChange} disabled={isLoading} /> - - - - New Profile - -