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

58 lines
1.4 KiB
TypeScript

import { ReactNode } from 'react'
import { cn } from '@/lib/utils'
import { Separator } from '@/components/ui/separator'
interface PanelHeaderProps {
title: string
subtitle?: string | ReactNode
icon?: ReactNode
actions?: ReactNode
className?: string
showSeparator?: boolean
}
export function PanelHeader({
title,
subtitle,
icon,
actions,
className,
showSeparator = true,
}: PanelHeaderProps) {
return (
<div className={cn('space-y-3', className)}>
<div className="flex items-start justify-between gap-4">
<div className="flex items-start gap-3 flex-1 min-w-0">
{icon && (
<div className="text-primary mt-0.5 shrink-0">
{icon}
</div>
)}
<div className="flex-1 min-w-0">
<h2 className="text-lg font-semibold text-foreground truncate">
{title}
</h2>
{subtitle && (
typeof subtitle === 'string' ? (
<p className="text-sm text-muted-foreground mt-1">
{subtitle}
</p>
) : (
<div className="mt-1">
{subtitle}
</div>
)
)}
</div>
</div>
{actions && (
<div className="flex items-center gap-2 shrink-0">
{actions}
</div>
)}
</div>
{showSeparator && <Separator />}
</div>
)
}