From ca74a157ca5cc22c9b4292c895af35be96b54588 Mon Sep 17 00:00:00 2001
From: xXJSONDeruloXx <danielhimebauch@gmail.com>
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/components/ProfileManagement.tsx')

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 (
     <PanelSection title="Select Profile">
@@ -275,21 +289,11 @@ export function ProfileManagement({ currentProfile, onProfileChange }: ProfileMa
           <Dropdown
             rgOptions={profileOptions}
             selectedOption={selectedProfile}
-            onChange={(option) => handleProfileChange(option.data)}
+            onChange={handleDropdownChange}
             disabled={isLoading}
           />
         </Field>
       </PanelSectionRow>
-
-      <PanelSectionRow>
-        <ButtonItem
-          layout="below"
-          onClick={handleCreateProfile}
-          disabled={isLoading}
-        >
-          New Profile
-        </ButtonItem>
-      </PanelSectionRow>
       
       <PanelSectionRow>
         <ButtonItem
-- 
cgit v1.2.3

