mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
adding project features.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
"use client"
|
||||
import {SidebarMenu, SidebarMenuAction, SidebarMenuButton, SidebarMenuItem} from "@/components/ui/sidebar";
|
||||
|
||||
import {useEffect, useState} from "react";
|
||||
import Link from "next/link";
|
||||
import {SidebarMenu, SidebarMenuAction, SidebarMenuButton, SidebarMenuItem} from "@/components/ui/sidebar";
|
||||
import {cn} from "@/lib/utils";
|
||||
import {buttonVariants} from "@/components/ui/button";
|
||||
import {PropsWithChildren, useEffect, useState} from "react";
|
||||
import {ChartArea, Home, Settings, ShieldHalf} from "lucide-react";
|
||||
import {ChartArea, FolderKanban, Home, Settings, ShieldHalf} from "lucide-react";
|
||||
import {usePathname} from "next/navigation";
|
||||
|
||||
export type SidebarMenuCustomProps = {}
|
||||
@@ -20,6 +21,11 @@ export const SidebarMenuCustom = (props: SidebarMenuCustomProps) => {
|
||||
// url: "/",
|
||||
// icon: Home,
|
||||
// },
|
||||
{
|
||||
title: "Projects",
|
||||
url: "projects",
|
||||
icon: FolderKanban,
|
||||
},
|
||||
{
|
||||
title: "Agents",
|
||||
url: "agents",
|
||||
|
||||
@@ -4,18 +4,21 @@ import {
|
||||
SidebarGroupLabel,
|
||||
SidebarHeader,
|
||||
SidebarMenu,
|
||||
SidebarMenuButton,
|
||||
SidebarMenuItem,
|
||||
} from "@/components/ui/sidebar"
|
||||
import {DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger} from "@/components/ui/dropdown-menu";
|
||||
import {
|
||||
ChevronDown
|
||||
} from "lucide-react";
|
||||
import {LoggedInButton} from "@/components/wrappers/Dashboard/LoggedInButton/LoggedInButton";
|
||||
import {SidebarMenuCustom} from "@/components/wrappers/Dashboard/SideBar/SideBarMenu/SideBarMenu";
|
||||
import Image from 'next/image';
|
||||
import {OrganizationComboBox} from "@/components/wrappers/organization/OrganizationCombobox";
|
||||
import {prisma} from "@/prisma";
|
||||
|
||||
export function AppSidebar() {
|
||||
export async function AppSidebar() {
|
||||
|
||||
const organizations = await prisma.organization.findMany({})
|
||||
const defaultOrganization = await prisma.organization.findUnique({
|
||||
where: {
|
||||
slug: "default"
|
||||
}
|
||||
})
|
||||
|
||||
return (
|
||||
<Sidebar collapsible="icon">
|
||||
@@ -25,22 +28,10 @@ export function AppSidebar() {
|
||||
</div>
|
||||
<SidebarMenu>
|
||||
<SidebarMenuItem>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
<SidebarMenuButton>
|
||||
Select Project
|
||||
<ChevronDown className="ml-auto"/>
|
||||
</SidebarMenuButton>
|
||||
</DropdownMenuTrigger>
|
||||
<DropdownMenuContent className="w-[--radix-popper-anchor-width]">
|
||||
<DropdownMenuItem>
|
||||
<span>Project 1</span>
|
||||
</DropdownMenuItem>
|
||||
<DropdownMenuItem>
|
||||
<span>Project 2</span>
|
||||
</DropdownMenuItem>
|
||||
</DropdownMenuContent>
|
||||
</DropdownMenu>
|
||||
<OrganizationComboBox
|
||||
organizations={organizations}
|
||||
defaultOrganization={defaultOrganization}
|
||||
/>
|
||||
</SidebarMenuItem>
|
||||
</SidebarMenu>
|
||||
</SidebarHeader>
|
||||
|
||||
Reference in New Issue
Block a user