|
1 | 1 | import type { OrganizationInfo } from "@dafthunk/types"; |
| 2 | +import { |
| 3 | + Database, |
| 4 | + KeyRound, |
| 5 | + LayoutDashboard, |
| 6 | + Lock, |
| 7 | + Logs, |
| 8 | + SquareTerminal, |
| 9 | + Target, |
| 10 | + Users, |
| 11 | +} from "lucide-react"; |
2 | 12 | import React, { useEffect } from "react"; |
3 | 13 | import { useParams } from "react-router"; |
4 | 14 |
|
5 | 15 | import { useAuth } from "@/components/auth-context"; |
6 | 16 | import { AppLayout } from "@/components/layouts/app-layout"; |
7 | | -import { getDashboardSidebarItems } from "@/routes"; |
8 | 17 | import { useOrganizations } from "@/services/organizations-service"; |
9 | 18 |
|
10 | 19 | interface OrgLayoutProps { |
11 | 20 | children: React.ReactNode; |
12 | 21 | title: string; |
13 | 22 | } |
14 | 23 |
|
| 24 | +export const getDashboardSidebarItems = (orgHandle: string) => [ |
| 25 | + { |
| 26 | + title: "Dashboard", |
| 27 | + url: `/org/${orgHandle}/dashboard`, |
| 28 | + icon: LayoutDashboard, |
| 29 | + }, |
| 30 | + { |
| 31 | + title: "Workflows", |
| 32 | + url: `/org/${orgHandle}/workflows`, |
| 33 | + icon: SquareTerminal, |
| 34 | + }, |
| 35 | + |
| 36 | + { |
| 37 | + title: "Datasets", |
| 38 | + url: `/org/${orgHandle}/datasets`, |
| 39 | + icon: Database, |
| 40 | + }, |
| 41 | + { |
| 42 | + title: "Secrets", |
| 43 | + url: `/org/${orgHandle}/secrets`, |
| 44 | + icon: Lock, |
| 45 | + }, |
| 46 | + { |
| 47 | + title: "Deployments", |
| 48 | + url: `/org/${orgHandle}/deployments`, |
| 49 | + icon: Target, |
| 50 | + }, |
| 51 | + { |
| 52 | + title: "Executions", |
| 53 | + url: `/org/${orgHandle}/executions`, |
| 54 | + icon: Logs, |
| 55 | + }, |
| 56 | + { |
| 57 | + title: "API Keys", |
| 58 | + url: `/org/${orgHandle}/api-keys`, |
| 59 | + icon: KeyRound, |
| 60 | + }, |
| 61 | + { |
| 62 | + title: "Members", |
| 63 | + url: `/org/${orgHandle}/members`, |
| 64 | + icon: Users, |
| 65 | + }, |
| 66 | +]; |
| 67 | + |
15 | 68 | export const OrgLayout: React.FC<OrgLayoutProps> = ({ children, title }) => { |
16 | 69 | const params = useParams<{ handle: string }>(); |
17 | 70 | const { organization, setSelectedOrganization } = useAuth(); |
|
0 commit comments