33import { useState } from 'react'
44import type { RecentItem } from '@sim/emcn-platform/recent-items'
55import { useRouter , useSearchParams } from 'next/navigation'
6+ import type { ShellWorkspace } from '@/app/(product)/_components/model'
67import {
78 useInterfacePreferences ,
89 useRecentHistory ,
@@ -17,6 +18,7 @@ import type {
1718import { surfaceHref } from '@/platform/lib/data/organization-model'
1819import { platformHref } from '@/platform/lib/navigation'
1920import { useSurfaceScope } from '@/platform/lib/surface-scope'
21+ import { workspaceHomePath } from '@/platform/lib/workspace-navigation'
2022import type {
2123 HomeCalendarDay ,
2224 HomeConnectOption ,
@@ -71,10 +73,12 @@ function metricPoints(data: HomeData | null, field: 'tasks' | 'searches') {
7173interface FixtureHomeProps {
7274 data : HomeData | null
7375 recentLinks : readonly RecentItem [ ]
76+ /** The sidebar's example workspaces, which Home's Workspaces lists without claiming any activity. */
77+ workspaces : readonly ShellWorkspace [ ]
7478}
7579
7680/** The session implementation of Home's view: edits last as long as the product session. */
77- export function FixtureHome ( { data, recentLinks } : FixtureHomeProps ) {
81+ export function FixtureHome ( { data, recentLinks, workspaces } : FixtureHomeProps ) {
7882 const router = useRouter ( )
7983 const search = useSearchParams ( )
8084 const scope = useSurfaceScope ( )
@@ -115,6 +119,14 @@ export function FixtureHome({ data, recentLinks }: FixtureHomeProps) {
115119 calendarForOffset ( data , dayOffset )
116120 )
117121 : { status : 'not_connected' , options : CONNECT_OPTIONS . Calendar } ,
122+ workspaces : {
123+ status : 'ready' ,
124+ items : workspaces . map ( ( { id, name } ) => ( {
125+ id,
126+ name,
127+ href : platformHref ( workspaceHomePath ( id , 'fixture' ) , search ) ,
128+ } ) ) ,
129+ } ,
118130 recents : { status : 'ready' , items : recents } ,
119131 getStarted : [ ] ,
120132 composerInventory : data ?. composerInventory ,
@@ -127,6 +139,7 @@ export function FixtureHome({ data, recentLinks }: FixtureHomeProps) {
127139 returnToToday : ( ) => setDayOffset ( 0 ) ,
128140 retryAttention : ( ) => { } ,
129141 retryActivity : ( ) => { } ,
142+ retryWorkspaces : ( ) => { } ,
130143 retryRecents : ( ) => { } ,
131144 removeRecent,
132145 }
0 commit comments