Skip to content

Commit

Permalink
Added Avatar instead of Empty Div
Browse files Browse the repository at this point in the history
  • Loading branch information
AnveshNalimela committed Jan 9, 2025
1 parent 8bec8bc commit f950e1b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/components/ui/sidebar/nav-main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ import {
useSidebar,
} from "@/components/ui/sidebar";

import { Avatar } from "@/components/Common/Avatar";

export function NavMain({
links,
}: {
Expand Down Expand Up @@ -45,8 +47,16 @@ export function NavMain({
activeClass="bg-white text-green-700 shadow"
exactActiveClass="bg-white text-green-700 shadow"
>
{link.icon && <CareIcon icon={link.icon as IconName} />}
<span className="group-data-[collapsible=icon]:hidden">
{link.icon ? (
<CareIcon icon={link.icon as IconName} />
) : (
<Avatar
name={link.name}
className="w-6 h-6 -m-1 rounded-sm"
/>
)}

<span className="group-data-[collapsible=icon]:hidden ml-1">
{link.name}
</span>
</ActiveLink>
Expand Down

0 comments on commit f950e1b

Please sign in to comment.