Skip to content

The complete open source platform to run your entire marketplace. Storefront, vendor panel, admin console, and integrations in one enterprise-grade platform you own.

689 B
Raw Blame
import { UserDropdown } from "@/components/cells/UserDropdown/UserDropdown"
import { MessageButton } from "@/components/molecules/MessageButton/MessageButton"
import { CustomerTalkJsProvider } from "@/components/providers/TalkJs/CustomerTalkJsProvider"
import { retrieveCustomer } from "@/lib/data/customer"

export const HeaderAccount = async () => {
  const user = await retrieveCustomer().catch(() => null)
  const isLoggedIn = Boolean(user)

  return (
    <CustomerTalkJsProvider>
      {isLoggedIn && <MessageButton />}
      <UserDropdown isLoggedIn={isLoggedIn} />
    </CustomerTalkJsProvider>
  )
}

export const HeaderAccountFallback = () => <UserDropdown isLoggedIn={false} />