Skip to content

Commit e02beb3

Browse files
committed
Enhance RecordDetailView with padding and dynamic title for improved layout and usability
1 parent 33f08ea commit e02beb3

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

apps/console/src/App.tsx

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ function RecordDetailView({ dataSource, objects, onEdit }: any) {
3636
}
3737

3838
return (
39-
<div className="h-full bg-background overflow-auto">
39+
<div className="h-full bg-background overflow-auto p-4 lg:p-6">
4040
<DetailView
4141
schema={{
4242
type: 'detail-view',
@@ -45,23 +45,24 @@ function RecordDetailView({ dataSource, objects, onEdit }: any) {
4545
showBack: true,
4646
onBack: 'history',
4747
showEdit: true,
48+
title: objectDef.label,
4849
sections: [
4950
{
5051
title: 'Details',
5152
fields: Object.keys(objectDef.fields || {}).map(key => ({
5253
name: key,
53-
label: objectDef.fields[key].label,
54-
type: objectDef.fields[key].type
54+
label: objectDef.fields[key].label || key,
55+
type: objectDef.fields[key].type || 'text'
5556
})),
5657
columns: 2
5758
}
5859
]
5960
}}
6061
dataSource={dataSource}
61-
onEdit={() => onEdit({ _id: recordId, id: recordId })}
62+
onEdit={() => onEdit({ _id: recordId, id: recordId })}
6263
/>
6364
</div>
64-
)
65+
);
6566
}
6667

6768
export function AppContent() {

0 commit comments

Comments
 (0)