@@ -165,58 +165,68 @@ export function ObjectView({ dataSource, objects, onEdit }: any) {
165165 } ;
166166
167167 return (
168- < div className = "h-full flex flex-col" >
169- { /* Header Section */ }
170- < div className = "flex justify-between items-center py-4 px-6 border-b shrink-0 bg-background/95 backdrop-blur z-10 sticky top-0" >
171- < div className = "flex items-center gap-4" >
172- < div className = "flex items-center gap-3" >
173- < div className = "bg-primary/10 p-2 rounded-lg shrink-0" >
174- { /* Map icons based on object name if possible, fallback to generic */ }
175- < TableIcon className = "h-5 w-5 text-primary" />
176- </ div >
177- < div >
178- < h1 className = "text-xl font-bold tracking-tight text-foreground" > { objectDef . label } </ h1 >
179- < p className = "text-sm text-muted-foreground" > { activeView . label } </ p >
180- </ div >
168+ < div className = "h-full flex flex-col bg-background" >
169+ { /* 1. Main Header */ }
170+ < div className = "flex justify-between items-center py-3 px-4 border-b shrink-0 bg-background z-10" >
171+ < div className = "flex items-center gap-3" >
172+ < div className = "bg-primary/10 p-2 rounded-md shrink-0" >
173+ < TableIcon className = "h-4 w-4 text-primary" />
174+ </ div >
175+ < div >
176+ < h1 className = "text-lg font-semibold tracking-tight text-foreground" > { objectDef . label } </ h1 >
181177 </ div >
182-
183- { /* View Switcher - Re-styled as refined segmented control */ }
184- { views . length > 1 && (
185- < div className = "ml-4 h-8 bg-muted/50 rounded-lg p-1 flex items-center" >
186- { views . map ( ( v : any ) => (
187- < button
188- key = { v . id }
189- onClick = { ( ) => handleViewChange ( v . id ) }
190- className = { `
191- flex items-center gap-2 px-3 h-full rounded-md text-sm font-medium transition-all
192- ${ activeView . id === v . id
193- ? 'bg-background shadow-sm text-foreground'
194- : 'text-muted-foreground hover:bg-background/50 hover:text-foreground/80'
195- }
196- ` }
197- >
198- { v . type === 'kanban' && < KanbanIcon className = "h-3.5 w-3.5" /> }
199- { v . type === 'calendar' && < CalendarIcon className = "h-3.5 w-3.5" /> }
200- { v . type === 'grid' && < TableIcon className = "h-3.5 w-3.5" /> }
201- { v . type === 'gantt' && < AlignLeft className = "h-3.5 w-3.5" /> }
202- < span > { v . label } </ span >
203- </ button >
204- ) ) }
205- </ div >
206- ) }
207178 </ div >
208179
209180 < div className = "flex items-center gap-2" >
210- < Button onClick = { ( ) => onEdit ( null ) } className = "shadow-none gap-2" >
181+ < Button size = "sm" onClick = { ( ) => onEdit ( null ) } className = "shadow-none gap-2" >
211182 < Plus className = "h-4 w-4" />
212183 < span className = "hidden sm:inline" > New</ span >
213184 </ Button >
214185 </ div >
215186 </ div >
216187
217- { /* Content Area */ }
218- < div className = "flex-1 bg-muted/5 p-4 sm:p-6 overflow-hidden" >
219- < div className = "h-full w-full rounded-xl border bg-card text-card-foreground shadow-sm overflow-hidden relative" >
188+ { /* 2. View Toolbar (Tabs & Controls) */ }
189+ < div className = "flex justify-between items-center py-2 px-4 border-b shrink-0 bg-muted/20" >
190+ { /* Left: View Tabs */ }
191+ < div className = "flex items-center gap-1 overflow-x-auto no-scrollbar" >
192+ { views . map ( ( v : any ) => {
193+ const isActive = activeView . id === v . id ;
194+ return (
195+ < button
196+ key = { v . id }
197+ onClick = { ( ) => handleViewChange ( v . id ) }
198+ className = { `
199+ flex items-center gap-2 px-3 py-1.5 rounded-md text-sm font-medium transition-all whitespace-nowrap
200+ ${ isActive
201+ ? 'bg-background shadow-sm text-foreground ring-1 ring-border/50'
202+ : 'text-muted-foreground hover:bg-background/50 hover:text-foreground'
203+ }
204+ ` }
205+ >
206+ { v . type === 'kanban' && < KanbanIcon className = "h-3.5 w-3.5 opacity-70" /> }
207+ { v . type === 'calendar' && < CalendarIcon className = "h-3.5 w-3.5 opacity-70" /> }
208+ { v . type === 'grid' && < TableIcon className = "h-3.5 w-3.5 opacity-70" /> }
209+ { v . type === 'gantt' && < AlignLeft className = "h-3.5 w-3.5 opacity-70" /> }
210+ < span > { v . label } </ span >
211+ </ button >
212+ ) ;
213+ } ) }
214+ </ div >
215+
216+ { /* Right: View Options (Placeholder for now) */ }
217+ < div className = "flex items-center gap-2 hidden md:flex" >
218+ < Button variant = "ghost" size = "sm" className = "h-8 text-muted-foreground" >
219+ < span className = "text-xs" > Filter</ span >
220+ </ Button >
221+ < Button variant = "ghost" size = "sm" className = "h-8 text-muted-foreground" >
222+ < span className = "text-xs" > Sort</ span >
223+ </ Button >
224+ </ div >
225+ </ div >
226+
227+ { /* 3. Content Area (Edge-to-Edge) */ }
228+ < div className = "flex-1 overflow-hidden relative" >
229+ < div className = "absolute inset-0" >
220230 { renderCurrentView ( ) }
221231 </ div >
222232 </ div >
0 commit comments