The commit simplifies user authorization in 'AdminSidebar' component by removing unnecessary imports and functions and passing user directly as a prop instead. This change optimizes code readability and makes user authorization more efficient.
43 lines
1.1 KiB
TypeScript
43 lines
1.1 KiB
TypeScript
import { User } from '@supabase/supabase-js';
|
|
|
|
import { Home, Users } from 'lucide-react';
|
|
|
|
import {
|
|
Sidebar,
|
|
SidebarContent,
|
|
SidebarGroup,
|
|
SidebarItem,
|
|
} from '@kit/ui/sidebar';
|
|
|
|
import { AppLogo } from '~/components/app-logo';
|
|
import { ProfileAccountDropdownContainer } from '~/components/personal-account-dropdown-container';
|
|
|
|
export function AdminSidebar(props: { user: User }) {
|
|
return (
|
|
<Sidebar>
|
|
<SidebarContent className={'py-4'}>
|
|
<AppLogo href={'/admin'} />
|
|
</SidebarContent>
|
|
|
|
<SidebarContent className={'mt-5'}>
|
|
<SidebarGroup label={'Admin'} collapsible={false}>
|
|
<SidebarItem end path={'/admin'} Icon={<Home className={'h-4'} />}>
|
|
Home
|
|
</SidebarItem>
|
|
|
|
<SidebarItem
|
|
path={'/admin/accounts'}
|
|
Icon={<Users className={'h-4'} />}
|
|
>
|
|
Accounts
|
|
</SidebarItem>
|
|
</SidebarGroup>
|
|
</SidebarContent>
|
|
|
|
<SidebarContent className={'absolute bottom-4'}>
|
|
<ProfileAccountDropdownContainer user={props.user} collapsed={false} />
|
|
</SidebarContent>
|
|
</Sidebar>
|
|
);
|
|
}
|