import { RectangleElement, CircleElement } from '../../types/elements';
import { NumericPropertyInput } from '../ui/NumericPropertyInput';
import { ColorPropertyInput } from '../ui/ColorPropertyInput';
type ShapeElement = RectangleElement | CircleElement;
interface ShapePropertiesProps {
element: ShapeElement;
onChange: (elementId: string, property: string, value: unknown) => void;
activeTab: { [key: string]: 'fonctionnalites' | 'personnalisation' | 'positionnement' };
setActiveTab: (tabs: { [key: string]: 'fonctionnalites' | 'personnalisation' | 'positionnement' }) => void;
}
export function ShapeProperties({ element, onChange, activeTab, setActiveTab }: ShapePropertiesProps) {
const shapeCurrentTab = activeTab[element.id] || 'fonctionnalites';
const setShapeCurrentTab = (tab: 'fonctionnalites' | 'personnalisation' | 'positionnement') => {
setActiveTab({ ...activeTab, [element.id]: tab });
};
return (
<>
{/* Système d'onglets pour Shape */}
{/* Onglet Fonctionnalités */}
{shapeCurrentTab === 'fonctionnalites' && (
<>
{element.type === 'circle' && (
)}
{element.type === 'rectangle' && (
<>
onChange(element.id, 'borderRadius', value)}
/>
>
)}
>
)}
{/* Onglet Personnalisation */}
{shapeCurrentTab === 'personnalisation' && (
<>
onChange(element.id, 'fillColor', value)}
/>
onChange(element.id, 'strokeColor', value)}
/>
onChange(element.id, 'strokeWidth', value)}
/>
>
)}
{/* Onglet Positionnement */}
{shapeCurrentTab === 'positionnement' && (
<>
onChange(element.id, 'x', value)}
/>
onChange(element.id, 'y', value)}
/>
onChange(element.id, 'width', value)}
/>
onChange(element.id, 'height', value)}
/>
onChange(element.id, 'rotation', value)}
/>
onChange(element.id, 'padding', value)}
/>
onChange(element.id, 'opacity', parseFloat(e.target.value))}
style={{ width: '100%' }}
/>
>
)}
>
);
}