aboutsummaryrefslogtreecommitdiff
path: root/packages
diff options
context:
space:
mode:
authorDhravya <[email protected]>2024-06-30 14:26:16 -0500
committerDhravya <[email protected]>2024-06-30 14:26:16 -0500
commit75940c1936d302f56005a850f1799762a5113a9b (patch)
treec76748635acabaab882c4713020aa6cd39edb0e4 /packages
parentimport using extension (diff)
downloadsupermemory-75940c1936d302f56005a850f1799762a5113a9b.tar.xz
supermemory-75940c1936d302f56005a850f1799762a5113a9b.zip
UX improvement: Create space disabled when input value is ''
Diffstat (limited to 'packages')
-rw-r--r--packages/ui/shadcn/combobox.tsx9
1 files changed, 8 insertions, 1 deletions
diff --git a/packages/ui/shadcn/combobox.tsx b/packages/ui/shadcn/combobox.tsx
index ad70047f..4883ea19 100644
--- a/packages/ui/shadcn/combobox.tsx
+++ b/packages/ui/shadcn/combobox.tsx
@@ -57,8 +57,15 @@ const ComboboxWithCreate: React.FC<ComboboxWithCreateProps> = ({
type="button"
onClick={async () => onSubmit(inputValue)}
variant="link"
+ disabled={inputValue.length === 0}
>
- {createNewMessage} "{inputValue}"
+ {inputValue.length > 0 ? (
+ <>
+ {createNewMessage} "{inputValue}"
+ </>
+ ) : (
+ <>Create a space by typing here</>
+ )}
</Button>
<p>Start by creating a space and adding content to it</p>
</CommandEmpty>