import React, { useState } from 'react'; import { EnhancedModal } from './EnhancedModal'; import { TabGroup, TabPanel, Tab } from './TabGroup'; import { CodeDisplay } from './CodeDisplay'; import './style.scss'; export interface CodeTab { id: string; label: string; code: string; language?: string; } export interface CodeModalProps { /** Whether the modal is open */ isOpen: boolean; /** Close handler */ onClose: () => void; /** Modal title */ title?: string; /** Code tabs to display */ tabs: CodeTab[]; /** Default active tab */ defaultTab?: string; /** Show line numbers in code */ showLineNumbers?: boolean; /** Custom width */ width?: string | number; /** Custom max width */ maxWidth?: string | number; } export const CodeModal: React.FC = ({ isOpen, onClose, title = 'Generated Code', tabs, defaultTab, showLineNumbers = false, width, maxWidth = '900px' }) => { const [activeTab, setActiveTab] = useState(defaultTab || tabs[0]?.id || ''); const tabItems: Tab[] = tabs.map(tab => ({ id: tab.id, label: tab.label })); const header = ( <>

{title}

); return ( {tabs.length > 1 && (
)}
{tabs.map(tab => ( ))}
); };