mirror of
https://github.com/johndoe6345789/low-code-react-app-b.git
synced 2026-05-01 00:54:55 +00:00
- Created hooks-registry.ts for registering custom React hooks - Created createJsonComponentWithHooks for JSON components that need hooks - Implemented SaveIndicator as pure JSON with useSaveIndicator hook - Moved JSON definitions from wrappers/definitions to components/json-definitions - Removed wrappers folder entirely - Fixed NavigationItem JSON to include onClick handler binding - Deleted legacy NavigationItem.tsx and PageHeaderContent.tsx files - Architecture: JSON + interfaces + hook loader = fully functional components Co-authored-by: johndoe6345789 <224850594+johndoe6345789@users.noreply.github.com>
43 lines
1.1 KiB
JSON
43 lines
1.1 KiB
JSON
{
|
|
"id": "save-indicator-container",
|
|
"type": "div",
|
|
"bindings": {
|
|
"className": {
|
|
"source": "className",
|
|
"transform": "data ? `flex items-center gap-1.5 text-xs text-muted-foreground ${data}` : 'flex items-center gap-1.5 text-xs text-muted-foreground'"
|
|
}
|
|
},
|
|
"children": [
|
|
{
|
|
"id": "status-icon",
|
|
"type": "StatusIcon",
|
|
"bindings": {
|
|
"type": {
|
|
"source": "lastSaved",
|
|
"transform": "data ? (hookData.isRecent ? 'saved' : 'synced') : status"
|
|
},
|
|
"animate": {
|
|
"source": "animate",
|
|
"transform": "data !== undefined ? data : (lastSaved ? hookData.isRecent : status === 'saved')"
|
|
}
|
|
}
|
|
},
|
|
{
|
|
"id": "label-text",
|
|
"type": "span",
|
|
"props": {
|
|
"className": "hidden sm:inline"
|
|
},
|
|
"bindings": {
|
|
"children": {
|
|
"source": "label",
|
|
"transform": "data || (lastSaved ? (hookData.isRecent ? 'Saved' : hookData.timeAgo) : (status === 'saved' ? 'Saved' : 'Synced'))"
|
|
}
|
|
},
|
|
"conditional": {
|
|
"if": "showLabel !== false"
|
|
}
|
|
}
|
|
]
|
|
}
|