@@ -165,49 +165,58 @@ export function ObjectView({ dataSource, objects, onEdit }: any) {
165165 } ;
166166
167167 return (
168- < div className = "h-full flex flex-col gap-4 " >
168+ < div className = "h-full flex flex-col" >
169169 { /* Header Section */ }
170- < div className = "flex justify-between items-start" >
171- < div className = "space-y-1" >
172- < h1 className = "text-2xl font-bold tracking-tight text-slate-900" > { objectDef . label } </ h1 >
173- < div className = "flex items-center gap-2" >
174- { /* View Switcher Tabs */ }
175- { views . length > 1 && (
176- < Tabs value = { activeView . id } onValueChange = { handleViewChange } className = "h-8" >
177- < TabsList className = "h-8 p-0 bg-transparent border-0 gap-2" >
178- { views . map ( ( v : any ) => (
179- < TabsTrigger
180- key = { v . id }
181- value = { v . id }
182- className = "h-8 px-3 data-[state=active]:bg-muted data-[state=active]:shadow-none border border-transparent data-[state=active]:border-border rounded-md transition-all"
183- >
184- { v . type === 'kanban' && < KanbanIcon className = "mr-2 h-3.5 w-3.5" /> }
185- { v . type === 'calendar' && < CalendarIcon className = "mr-2 h-3.5 w-3.5" /> }
186- { v . type === 'grid' && < TableIcon className = "mr-2 h-3.5 w-3.5" /> }
187- { v . type === 'gantt' && < AlignLeft className = "mr-2 h-3.5 w-3.5" /> }
188- { v . label }
189- </ TabsTrigger >
190- ) ) }
191- </ TabsList >
192- </ Tabs >
193- ) }
194- { views . length <= 1 && (
195- < p className = "text-slate-500 text-sm" >
196- { objectDef . description || 'Manage your records' }
197- </ p >
198- ) }
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 >
199181 </ 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+ ) }
200207 </ div >
201- < div className = "flex gap-2" >
202- < Button onClick = { ( ) => onEdit ( null ) } className = "shadow-none" >
203- < Plus className = "mr-2 h-4 w-4" /> New { objectDef . label }
208+
209+ < div className = "flex items-center gap-2" >
210+ < Button onClick = { ( ) => onEdit ( null ) } className = "shadow-none gap-2" >
211+ < Plus className = "h-4 w-4" />
212+ < span className = "hidden sm:inline" > New</ span >
204213 </ Button >
205214 </ div >
206215 </ div >
207216
208217 { /* Content Area */ }
209- < div className = "flex-1 rounded-xl border bg-card text-card-foreground shadow-sm overflow-hidden p-0 relative " >
210- < div className = "absolute inset-0 " >
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 " >
211220 { renderCurrentView ( ) }
212221 </ div >
213222 </ div >
0 commit comments