Files
low-code-react-app-b/src/components/json-definitions/save-indicator.json
copilot-swe-agent[bot] 4c17cc49c1 feat: Implement hooks loader system for JSON components, convert SaveIndicator to pure JSON
- 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>
2026-01-18 23:22:40 +00:00

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"
}
}
]
}