Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Start Dashboard specific files

Terry Sutton57a1083f8f3b
diff --git a/packages/ui/src/components/Command/sections/DashboardTableEditor.tsx b/packages/ui/src/components/Command/sections/DashboardTableEditor.tsx
new file mode 100644
index 00000000000..48b560416f5
--- /dev/null
+++ b/packages/ui/src/components/Command/sections/DashboardTableEditor.tsx
@@ -0,0 +1,55 @@
+import { useRouter } from 'next/router'
+import * as React from 'react'
+import { IconArrowRight } from '../../Icon/icons/IconArrowRight'
+import dashboardItems from '../utils/dashboard-nav-items.json'
+import { CommandGroup, CommandItem, CommandLabel, CommandList } from '../Command.utils'
+import { useCommandMenu } from '../CommandMenuProvider'
+
+export default function DashboardTableEditor() {
+ const router = useRouter()
+ const { setPages, currentPage, pages } = useCommandMenu()
+ console.log('currentPage', currentPage)
+
+ return (
+ <CommandGroup heading={dashboardItems.tools.label}>
+ <CommandList>
+ {!currentPage && (
+ <>
+ <CommandItem type="command" onSelect={() => setPages([...pages, 'projects'])}>
+ Search projects…
+ </CommandItem>
+ <CommandItem type="command" onSelect={() => setPages([...pages, 'teams'])}>
+ Join a team…
+ </CommandItem>
+ </>
+ )}
+
+ {currentPage === 'projects' && (
+ <>
+ <CommandItem type="link">
+ <CommandLabel>
+ <span className="font-bold"> projects sub item</span>
+ </CommandLabel>
+ </CommandItem>
+ <CommandItem type="link">Project B</CommandItem>
+ </>
+ )}
+
+ {currentPage === 'teams' && (
+ <>
+ <CommandItem type="link">Team 1</CommandItem>
+ <CommandItem type="link">Team 2</CommandItem>
+ </>
+ )}
+ </CommandList>
+ {/* {dashboardItems.tools.items.map((item) => (
+ <CommandItem key={item.url} type="link" onSelect={() => router.push(item.url)}>
+ <IconArrowRight className="text-scale-900" />
+ <CommandLabel>
+ Go to <span className="font-bold"> {item.label}</span>
+ </CommandLabel>
+ </CommandItem>
+ ))} */}
+ </CommandGroup>
+ )
+}
diff --git a/packages/ui/src/components/Command/utils/dashboard-nav-items.json b/packages/ui/src/components/Command/utils/dashboard-nav-items.json
new file mode 100644
index 00000000000..3f85105ec7c
--- /dev/null
+++ b/packages/ui/src/components/Command/utils/dashboard-nav-items.json
@@ -0,0 +1,27 @@
+{
+ "tools": {
+ "label": "Dashboard Tools",
+ "items": [
+ {
+ "label": "dashboard - Database",
+ "url": "https://supabase.com/docs/guides/database"
+ },
+ {
+ "label": "dashboard - Auth",
+ "url": "https://supabase.com/docs/guides/auth/overview"
+ },
+ {
+ "label": "dashboard - Edge Functions",
+ "url": "https://supabase.com/docs/guides/functions"
+ },
+ {
+ "label": "dashboard - Realtime",
+ "url": "https://supabase.com/docs/guides/realtime"
+ },
+ {
+ "label": "dashboard - Storage",
+ "url": "https://supabase.com/docs/guides/storage"
+ }
+ ]
+ }
+}