@@ -6,16 +6,14 @@ import { Button } from "@/components/ui/button";
66import { UserProfileDropdown } from "./UserProfileDropdown" ;
77
88interface Props {
9- createNewText : string ;
10- createNewHref : string ;
9+ createNewConfig : { text : string ; href : string } | undefined ;
1110 mobileShowHamburger : boolean ;
1211 isMobileMenuOpen : boolean ;
1312 onToggleMobileMenu : ( ) => void ;
1413}
1514
1615export const NavbarActions = ( {
17- createNewText,
18- createNewHref,
16+ createNewConfig,
1917 mobileShowHamburger,
2018 isMobileMenuOpen,
2119 onToggleMobileMenu,
@@ -61,33 +59,33 @@ export const NavbarActions = ({
6159
6260 return (
6361 < div className = "flex items-center gap-2 sm:gap-3" >
64- { /* desktop only new listing button */ }
65- {
66- < Button
67- variant = "outline"
68- className = "border-primary text-primary hover:bg-primary hover:text-primary-foreground hidden gap-2 md:flex "
69- asChild
70- >
71- < Link href = { createNewHref } aria-label = { createNewText } >
72- < Plus className = "h-4 w-4" / >
73- < span > { createNewText } </ span >
74- </ Link >
75- </ Button >
76- }
62+ { createNewConfig && (
63+ < >
64+ { /* desktop only new listing button */ }
65+ < Button
66+ variant = "outline "
67+ className = "border-primary text-primary hover:bg-primary hover:text-primary-foreground hidden gap-2 md:flex"
68+ asChild
69+ >
70+ < Link href = { createNewConfig . href } aria-label = { createNewConfig . text } >
71+ < Plus className = "h-4 w-4" / >
72+ < span > { createNewConfig . text } </ span >
73+ </ Link >
74+ </ Button >
7775
78- { /* mobile only new listing button (icon only) */ }
79- {
80- < Button
81- variant = "outline "
82- size = "icon "
83- className = "border-primary text-primary hover:bg-primary hover:text-primary-foreground md:hidden"
84- asChild
85- >
86- < Link href = { createNewHref } aria-label = { createNewText } >
87- < Plus className = "h-4 w-4" / >
88- </ Link >
89- </ Button >
90- }
76+ { /* mobile only new listing button (icon only) */ }
77+ < Button
78+ variant = "outline"
79+ size = "icon "
80+ className = "border-primary text-primary hover:bg-primary hover:text-primary-foreground md:hidden "
81+ asChild
82+ >
83+ < Link href = { createNewConfig . href } aria-label = { createNewConfig . text } >
84+ < Plus className = "h-4 w-4" / >
85+ </ Link >
86+ </ Button >
87+ </ >
88+ ) }
9189
9290 { /* notification bell */ }
9391 < Button
0 commit comments