@@ -7,11 +7,13 @@ import {
77 Settings01Icon ,
88 UserIcon ,
99 HelpCircleIcon ,
10+ CreditCardIcon ,
1011 Github ,
1112} from "@hugeicons/core-free-icons" ;
1213import { useAuthStore } from "@/stores/auth" ;
1314import { planLabel } from "@livedot/shared/plans" ;
1415import ProfileModal from "./ProfileModal" ;
16+ import BillingModal from "./BillingModal" ;
1517
1618function getInitials ( username : string ) {
1719 return username . slice ( 0 , 2 ) . toUpperCase ( ) ;
@@ -21,6 +23,7 @@ export default function Navbar() {
2123 const navigate = useNavigate ( ) ;
2224 const { user, logout } = useAuthStore ( ) ;
2325 const [ profileOpen , setProfileOpen ] = useState ( false ) ;
26+ const [ billingOpen , setBillingOpen ] = useState ( false ) ;
2427
2528 return (
2629 < >
@@ -69,6 +72,7 @@ export default function Navbar() {
6972 < Dropdown . Menu
7073 onAction = { async ( key ) => {
7174 if ( key === "profile" ) setProfileOpen ( true ) ;
75+ if ( key === "billing" ) setBillingOpen ( true ) ;
7276 if ( key === "logout" ) {
7377 await logout ( ) ;
7478 navigate ( { to : "/auth/login" } ) ;
@@ -80,6 +84,12 @@ export default function Navbar() {
8084 < HugeiconsIcon icon = { UserIcon } size = { 16 } />
8185 My Account
8286 </ Dropdown . Item >
87+ { user ?. plan !== "ce" && (
88+ < Dropdown . Item id = "billing" textValue = "Billing" >
89+ < HugeiconsIcon icon = { CreditCardIcon } size = { 16 } />
90+ Billing
91+ </ Dropdown . Item >
92+ ) }
8393 < Dropdown . Item id = "settings" textValue = "Settings" >
8494 < HugeiconsIcon icon = { Settings01Icon } size = { 16 } />
8595 Settings
@@ -104,6 +114,7 @@ export default function Navbar() {
104114 </ nav >
105115
106116 < ProfileModal isOpen = { profileOpen } onOpenChange = { setProfileOpen } />
117+ < BillingModal isOpen = { billingOpen } onOpenChange = { setBillingOpen } />
107118 </ >
108119 ) ;
109120}
0 commit comments