import { BaseElement } from '../../types/elements'; import { useCanvasSettings } from '../../contexts/CanvasSettingsContext'; import { NumericPropertyInput } from '../ui/NumericPropertyInput'; import { ColorPropertyInput } from '../ui/ColorPropertyInput'; interface ExtendedElement extends BaseElement { strokeColor?: string; strokeWidth?: number; padding?: number; } interface LinePropertiesProps { element: ExtendedElement; onChange: (elementId: string, property: string, value: unknown) => void; activeTab: { [key: string]: 'fonctionnalites' | 'personnalisation' | 'positionnement' }; setActiveTab: (tabs: { [key: string]: 'fonctionnalites' | 'personnalisation' | 'positionnement' }) => void; } export function LineProperties({ element, onChange, activeTab, setActiveTab }: LinePropertiesProps) { const canvasSettings = useCanvasSettings(); const lineCurrentTab = activeTab[element.id] || 'fonctionnalites'; const setLineCurrentTab = (tab: 'fonctionnalites' | 'personnalisation' | 'positionnement') => { setActiveTab({ ...activeTab, [element.id]: tab }); }; return ( <> {/* Système d'onglets pour Line */}
{/* Onglet Fonctionnalités */} {lineCurrentTab === 'fonctionnalites' && ( <>
Ligne
)} {/* Onglet Personnalisation */} {lineCurrentTab === 'personnalisation' && ( <> onChange(element.id, 'strokeColor', value)} />
onChange(element.id, 'strokeWidth', value)} />
onChange(element.id, 'opacity', parseFloat(e.target.value))} style={{ width: '100%' }} />
)} {/* Onglet Positionnement */} {lineCurrentTab === 'positionnement' && ( <>
onChange(element.id, 'x', value)} />
onChange(element.id, 'y', value)} />
onChange(element.id, 'width', value)} />
{canvasSettings?.selectionRotationEnabled && (
onChange(element.id, 'rotation', value)} />
)}
onChange(element.id, 'padding', value)} />
)} ); }