add route
This commit is contained in:
@@ -17,7 +17,6 @@ import { WorkspaceSwitcher } from '@/components/workspace-switcher'
|
||||
import {
|
||||
Sidebar,
|
||||
SidebarContent,
|
||||
SidebarFooter,
|
||||
SidebarHeader,
|
||||
SidebarRail
|
||||
} from '@repo/ui/components/ui/sidebar'
|
||||
@@ -83,7 +82,7 @@ export function AppSidebar() {
|
||||
<SidebarHeader>
|
||||
<WorkspaceSwitcher />
|
||||
</SidebarHeader>
|
||||
<SidebarContent>
|
||||
<SidebarContent className="group-data-[state=expanded]:p-2">
|
||||
<NavMain data={data} />
|
||||
</SidebarContent>
|
||||
</Sidebar>
|
||||
|
||||
@@ -22,7 +22,7 @@ import {
|
||||
} from '@repo/ui/components/ui/sidebar'
|
||||
import { initials } from '@repo/ui/lib/utils'
|
||||
|
||||
type Workspace = {
|
||||
export type Workspace = {
|
||||
id: string
|
||||
name: string
|
||||
cnpj: string
|
||||
@@ -30,7 +30,7 @@ type Workspace = {
|
||||
|
||||
type WorkspaceContextProps = {
|
||||
workspaces: Workspace[]
|
||||
activeWorkspace: Workspace | null
|
||||
activeWorkspace: Workspace
|
||||
setActiveWorkspace: React.Dispatch<React.SetStateAction<Workspace | null>>
|
||||
}
|
||||
|
||||
@@ -54,8 +54,8 @@ export function WorkspaceProvider({
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
const { orgid } = useParams()
|
||||
const [activeWorkspace, setActiveWorkspace] = useState<Workspace | null>(
|
||||
() => workspaces.find((ws) => ws.id === orgid) ?? null
|
||||
const [activeWorkspace, setActiveWorkspace] = useState<Workspace | any>(
|
||||
() => workspaces.find((ws) => ws.id === orgid) || {}
|
||||
)
|
||||
|
||||
return (
|
||||
@@ -79,7 +79,7 @@ export function WorkspaceSwitcher() {
|
||||
}
|
||||
|
||||
return (
|
||||
<SidebarMenu>
|
||||
<SidebarMenu className="group-data-[state=expanded]:p-2">
|
||||
<SidebarMenuItem>
|
||||
<DropdownMenu>
|
||||
<DropdownMenuTrigger asChild>
|
||||
|
||||
Reference in New Issue
Block a user