Files
low-code-react-app-b/src/components/organisms/data-source-manager/DataSourceGroupSection.tsx
johndoe6345789 f05f896a67 feat: Complete JSON component migration for 9 components (atoms + BindingEditor)
Migration complete for:
- 5 atoms: Accordion, CopyButton, FileUpload, FilterInput, Image, Input, PasswordInput, Popover (8 total)
- 1 molecule: BindingEditor

Changes:
- Deleted 9 legacy TSX files that have complete JSON equivalents
- Exported BindingEditor from json-components.ts with useBindingEditor hook
- Registered useBindingEditor in hooks-registry.ts
- Updated all imports across codebase to use JSON-based components
- Fixed build errors: schema-loader dynamic import, DataSourceGroupSection
- Cleaned up component index exports

Build status:  PASSING
- 0 TypeScript errors
- All 9,408 modules transformed successfully
- No blocking build warnings

Next steps:
- 3 organisms still need conversion: DataSourceManager, NavigationMenu, TreeListPanel
- 120+ additional components have TSX versions (need individual migration)
- 22 JSON components now available for use throughout the app

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
2026-01-21 00:12:50 +00:00

59 lines
1.4 KiB
TypeScript

import { DataSource } from '@/types/json-ui'
import { IconText, Section, Stack } from '@/components/atoms'
import { ReactNode } from 'react'
interface DataSourceGroupSectionProps {
icon: ReactNode
label: string
dataSources: DataSource[]
getDependents: (id: string) => string[]
onEdit: (id: string) => void
onDelete: (id: string) => void
}
export function DataSourceGroupSection({
icon,
label,
dataSources,
getDependents,
onEdit,
onDelete,
}: DataSourceGroupSectionProps) {
if (dataSources.length === 0) {
return null
}
return (
<Section>
<IconText
icon={icon}
className="text-sm font-semibold mb-3"
>
{label} ({dataSources.length})
</IconText>
<Stack direction="vertical" spacing="sm">
{dataSources.map(ds => (
<div
key={ds.id}
className="p-3 border rounded-md hover:bg-gray-50"
>
<div className="font-medium text-sm">{ds.id}</div>
<button
onClick={() => onEdit(ds.id)}
className="text-xs text-blue-600 hover:underline mr-2"
>
Edit
</button>
<button
onClick={() => onDelete(ds.id)}
className="text-xs text-red-600 hover:underline"
>
Delete
</button>
</div>
))}
</Stack>
</Section>
)
}