user creation and other updates

This commit is contained in:
Henry Dollman
2024-07-13 19:43:14 -04:00
parent 357e3ad5d7
commit 054a56c316
10 changed files with 177 additions and 54 deletions

View File

@@ -1,6 +1,13 @@
'use client'
import { Database, Github, Home, Server } from 'lucide-react'
import {
Database,
DatabaseBackupIcon,
Github,
LayoutDashboard,
MailIcon,
Server,
} from 'lucide-react'
import {
CommandDialog,
@@ -16,7 +23,7 @@ import { useEffect, useState } from 'react'
import { useStore } from '@nanostores/react'
import { $servers, navigate } from '@/lib/stores'
export default function () {
export default function CommandPalette() {
const [open, setOpen] = useState(false)
const servers = useStore($servers)
@@ -39,24 +46,16 @@ export default function () {
<CommandEmpty>No results found.</CommandEmpty>
<CommandGroup heading="Suggestions">
<CommandItem
keywords={['home']}
onSelect={() => {
navigate('/')
setOpen((open) => !open)
}}
>
<Home className="mr-2 h-4 w-4" />
<span>Home</span>
<LayoutDashboard className="mr-2 h-4 w-4" />
<span>Dashboard</span>
<CommandShortcut>Page</CommandShortcut>
</CommandItem>
<CommandItem
onSelect={() => {
window.location.href = '/_/#/collections?collectionId=2hz5ncl8tizk5nx'
}}
>
<Database className="mr-2 h-4 w-4" />
<span>Admin UI</span>
<CommandShortcut>PocketBase</CommandShortcut>
</CommandItem>
<CommandItem
onSelect={() => {
window.location.href = 'https://github.com/henrygd'
@@ -79,9 +78,42 @@ export default function () {
>
<Server className="mr-2 h-4 w-4" />
<span>{server.name}</span>
<CommandShortcut>{server.host}</CommandShortcut>
</CommandItem>
))}
</CommandGroup>
<CommandSeparator />
<CommandGroup heading="Admin">
<CommandItem
onSelect={() => {
window.location.href = '/_/#/collections?collectionId=2hz5ncl8tizk5nx'
}}
>
<Database className="mr-2 h-4 w-4" />
<span>PocketBase</span>
<CommandShortcut>Admin</CommandShortcut>
</CommandItem>
<CommandItem
keywords={['email']}
onSelect={() => {
window.location.href = '/_/#/settings/backups'
}}
>
<DatabaseBackupIcon className="mr-2 h-4 w-4" />
<span>Database backups</span>
<CommandShortcut>Admin</CommandShortcut>
</CommandItem>
<CommandItem
keywords={['email']}
onSelect={() => {
window.location.href = '/_/#/settings/mail'
}}
>
<MailIcon className="mr-2 h-4 w-4" />
<span>SMTP settings</span>
<CommandShortcut>Admin</CommandShortcut>
</CommandItem>
</CommandGroup>
</CommandList>
</CommandDialog>
)