File tree Expand file tree Collapse file tree 2 files changed +18
-2
lines changed
Expand file tree Collapse file tree 2 files changed +18
-2
lines changed Original file line number Diff line number Diff line change 1+ import { ChevronDown , ChevronUp } from "lucide-react" ;
2+ import { cn } from "@/lib/utils" ;
3+
4+ interface ChevronIndicatorProps {
5+ isOpen : boolean ;
6+ className ?: string ;
7+ }
8+
9+ export function ChevronIndicator ( { isOpen, className } : ChevronIndicatorProps ) {
10+ const iconClassName = cn ( "size-4" , className ) ;
11+ return isOpen ? (
12+ < ChevronUp className = { iconClassName } />
13+ ) : (
14+ < ChevronDown className = { iconClassName } />
15+ ) ;
16+ }
Original file line number Diff line number Diff line change 11"use client" ;
22
3- import { ChevronDown , ChevronUp } from "lucide-react" ;
43import { useState } from "react" ;
54import { Button } from "@/components/ui/button" ;
5+ import { ChevronIndicator } from "@/components/ui/chevron-indicator" ;
66import {
77 DropdownMenu ,
88 DropdownMenuContent ,
@@ -24,7 +24,7 @@ export function UserMenu({ userName }: UserMenuProps) {
2424 < Button variant = "ghost" className = "flex items-center gap-2" >
2525 < UserAvatar userName = { userName } />
2626 < span > { userName } </ span >
27- { isOpen ? < ChevronUp /> : < ChevronDown /> }
27+ < ChevronIndicator isOpen = { isOpen } />
2828 </ Button >
2929 </ DropdownMenuTrigger >
3030 < DropdownMenuContent >
You can’t perform that action at this time.
0 commit comments