@@ -15,7 +15,7 @@ export function Workspace() {
1515 const [ showCreateGraphModal , setShowCreateGraphModal ] = useState ( false ) ;
1616 const [ showGraphSelectionModal , setShowGraphSelectionModal ] = useState ( false ) ;
1717 const [ viewMode , setViewMode ] = useState < 'graph' | 'dashboard' | 'table' | 'cards' | 'kanban' | 'gantt' | 'calendar' | 'activity' > ( 'graph' ) ;
18- const { currentGraph } = useGraph ( ) ;
18+ const { currentGraph, availableGraphs } = useGraph ( ) ;
1919 const { currentTeam, currentUser } = useAuth ( ) ;
2020
2121 // Get real-time counts for header display
@@ -255,31 +255,38 @@ export function Workspace() {
255255 </ h1 >
256256
257257 < h2 className = "text-lg font-medium text-green-300 mb-4" >
258- No Graph Selected
258+ { availableGraphs . length > 0 ? ' No Graph Selected' : 'No Graphs Available' }
259259 </ h2 >
260260
261261 < p className = "text-gray-300 mb-8 leading-relaxed" >
262- Ready to organize your work? Choose an existing graph or create a new one to get started.
262+ { availableGraphs . length > 0
263+ ? 'Ready to organize your work? Choose an existing graph or create a new one to get started.'
264+ : 'Get started by creating your first graph to organize your work.'
265+ }
263266 </ p >
264267
265268 { /* Action Buttons */ }
266269 < div className = "space-y-3 mb-8" >
267- < button
268- onClick = { ( ) => setShowGraphSelectionModal ( true ) }
269- className = "w-full px-6 py-3 bg-gray-700 hover:bg-gray-600 text-white rounded-lg transition-all duration-200 font-medium flex items-center justify-center shadow-lg hover:shadow-xl transform hover:-translate-y-0.5"
270- >
271- < svg className = "h-4 w-4 mr-2" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
272- < path strokeLinecap = "round" strokeLinejoin = "round" strokeWidth = "2" d = "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z" />
273- < path strokeLinecap = "round" strokeLinejoin = "round" strokeWidth = "2" d = "M8 5a2 2 0 012-2h4a2 2 0 012 2v3H8V5z" />
274- </ svg >
275- Select Graph
276- </ button >
270+ { availableGraphs . length > 0 && (
271+ < >
272+ < button
273+ onClick = { ( ) => setShowGraphSelectionModal ( true ) }
274+ className = "w-full px-6 py-3 bg-gray-700 hover:bg-gray-600 text-white rounded-lg transition-all duration-200 font-medium flex items-center justify-center shadow-lg hover:shadow-xl transform hover:-translate-y-0.5"
275+ >
276+ < svg className = "h-4 w-4 mr-2" fill = "none" stroke = "currentColor" viewBox = "0 0 24 24" >
277+ < path strokeLinecap = "round" strokeLinejoin = "round" strokeWidth = "2" d = "M3 7v10a2 2 0 002 2h14a2 2 0 002-2V9a2 2 0 00-2-2H5a2 2 0 00-2-2z" />
278+ < path strokeLinecap = "round" strokeLinejoin = "round" strokeWidth = "2" d = "M8 5a2 2 0 012-2h4a2 2 0 012 2v3H8V5z" />
279+ </ svg >
280+ Select Graph
281+ </ button >
277282
278- < div className = "flex items-center" >
279- < div className = "flex-1 border-t border-gray-600" > </ div >
280- < span className = "px-4 text-gray-400 text-xs font-medium bg-gray-900" > OR</ span >
281- < div className = "flex-1 border-t border-gray-600" > </ div >
282- </ div >
283+ < div className = "flex items-center" >
284+ < div className = "flex-1 border-t border-gray-600" > </ div >
285+ < span className = "px-4 text-gray-400 text-xs font-medium bg-gray-900" > OR</ span >
286+ < div className = "flex-1 border-t border-gray-600" > </ div >
287+ </ div >
288+ </ >
289+ ) }
283290
284291 < button
285292 onClick = { ( ) => setShowCreateGraphModal ( true ) }
0 commit comments