File tree Expand file tree Collapse file tree 1 file changed +14
-11
lines changed
packages/dashboard/src/lib/components/layout Expand file tree Collapse file tree 1 file changed +14
-11
lines changed Original file line number Diff line number Diff line change 11import { ChevronsUpDown , Languages , Plus } from 'lucide-react' ;
22
33import { ChannelCodeLabel } from '@/vdb/components/shared/channel-code-label.js' ;
4+ import { PermissionGuard } from '@/vdb/components/shared/permission-guard.js' ;
45import {
56 DropdownMenu ,
67 DropdownMenuContent ,
@@ -194,17 +195,19 @@ export function ChannelSwitcher() {
194195 orderedChannels . length > 1 && < DropdownMenuSeparator /> }
195196 </ div >
196197 ) ) }
197- < DropdownMenuSeparator />
198- < DropdownMenuItem className = "gap-2 p-2 cursor-pointer" asChild >
199- < Link to = { '/channels/new' } >
200- < div className = "bg-background flex size-6 items-center justify-center rounded-md border" >
201- < Plus className = "size-4" />
202- </ div >
203- < div className = "text-muted-foreground font-medium" >
204- < Trans > Add channel</ Trans >
205- </ div >
206- </ Link >
207- </ DropdownMenuItem >
198+ < PermissionGuard requires = { [ 'CreateChannel' ] } >
199+ < DropdownMenuSeparator />
200+ < DropdownMenuItem className = "gap-2 p-2 cursor-pointer" asChild >
201+ < Link to = { '/channels/new' } >
202+ < div className = "bg-background flex size-6 items-center justify-center rounded-md border" >
203+ < Plus className = "size-4" />
204+ </ div >
205+ < div className = "text-muted-foreground font-medium" >
206+ < Trans > Add channel</ Trans >
207+ </ div >
208+ </ Link >
209+ </ DropdownMenuItem >
210+ </ PermissionGuard >
208211 </ DropdownMenuContent >
209212 </ DropdownMenu >
210213 </ SidebarMenuItem >
You can’t perform that action at this time.
0 commit comments