add address
This commit is contained in:
@@ -30,6 +30,7 @@ import { initials } from '@repo/ui/lib/utils'
|
||||
import { Link } from 'react-router'
|
||||
|
||||
import type { Workspace, WorkspaceContextProps } from '@/middleware/workspace'
|
||||
import type { Address } from '@/routes/_.$orgid.enrollments.buy/review'
|
||||
|
||||
type Subscription = {
|
||||
billing_day: number
|
||||
@@ -39,6 +40,7 @@ type Subscription = {
|
||||
const WorkspaceContext = createContext<
|
||||
| (WorkspaceContextProps & {
|
||||
subscription: Subscription | null
|
||||
address: Address | null
|
||||
})
|
||||
| null
|
||||
>(null)
|
||||
@@ -57,11 +59,13 @@ export function WorkspaceProvider({
|
||||
activeWorkspace,
|
||||
workspaces,
|
||||
subscription,
|
||||
address,
|
||||
children
|
||||
}: {
|
||||
activeWorkspace: Workspace
|
||||
workspaces: Workspace[]
|
||||
subscription?: Subscription
|
||||
address?: Address
|
||||
children: React.ReactNode
|
||||
}) {
|
||||
return (
|
||||
@@ -69,6 +73,7 @@ export function WorkspaceProvider({
|
||||
value={{
|
||||
activeWorkspace,
|
||||
workspaces,
|
||||
address: address && Object.keys(address).length > 0 ? address : null,
|
||||
subscription:
|
||||
subscription && Object.keys(subscription).length > 0
|
||||
? subscription
|
||||
@@ -106,6 +111,7 @@ export function WorkspaceSwitcher() {
|
||||
{subscription && (
|
||||
<BadgeCheckIcon className="fill-blue-500 absolute size-3 -top-1 -right-1" />
|
||||
)}
|
||||
|
||||
{initials(activeWorkspace.name)}
|
||||
</div>
|
||||
<div className="grid flex-1 text-left text-sm leading-tight">
|
||||
|
||||
Reference in New Issue
Block a user