Files
low-code-react-app-b/src/components/molecules/FileTabs.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

41 lines
1.2 KiB
TypeScript

import { ProjectFile } from '@/types/project'
import { FileCode, X } from '@phosphor-icons/react'
import { Flex } from '@/components/atoms'
interface FileTabsProps {
files: ProjectFile[]
activeFileId: string | null
onFileSelect: (fileId: string) => void
onFileClose: (fileId: string) => void
}
export function FileTabs({ files, activeFileId, onFileSelect, onFileClose }: FileTabsProps) {
return (
<Flex align="center" gap="xs">
{files.map((file) => (
<button
key={file.id}
onClick={() => onFileSelect(file.id)}
className={`flex items-center gap-2 px-3 py-1.5 rounded text-sm transition-colors ${
file.id === activeFileId
? 'bg-card text-foreground'
: 'text-muted-foreground hover:text-foreground hover:bg-card/50'
}`}
>
<FileCode size={16} />
<span>{file.name}</span>
<button
onClick={(e) => {
e.stopPropagation()
onFileClose(file.id)
}}
className="hover:text-destructive"
>
<X size={14} />
</button>
</button>
))}
</Flex>
)
}