import { TextElement } from "../../types/elements";
import { NumericPropertyInput } from "../ui/NumericPropertyInput";
import { ColorPropertyInput } from "../ui/ColorPropertyInput";
interface TextPropertiesProps {
element: TextElement;
onChange: (elementId: string, property: string, value: unknown) => void;
activeTab: {
[key: string]: "fonctionnalites" | "personnalisation" | "positionnement";
};
setActiveTab: (tabs: {
[key: string]: "fonctionnalites" | "personnalisation" | "positionnement";
}) => void;
}
export function TextProperties({
element,
onChange,
activeTab,
setActiveTab,
}: TextPropertiesProps) {
const textCurrentTab = activeTab[element.id] || "fonctionnalites";
const setTextCurrentTab = (
tab: "fonctionnalites" | "personnalisation" | "positionnement",
) => {
setActiveTab({ ...activeTab, [element.id]: tab });
};
return (
<>
{/* Système d'onglets pour Text */}
{/* Onglet Fonctionnalités */}
{textCurrentTab === "fonctionnalites" && (
<>
>
)}
{/* Onglet Personnalisation */}
{textCurrentTab === "personnalisation" && (
<>
onChange(element.id, "fontSize", value)}
description="Taille de la police en pixels"
/>
onChange(element.id, "color", value)}
/>
onChange(element.id, "backgroundColor", value)}
/>
>
)}
{/* Onglet Positionnement */}
{textCurrentTab === "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%" }}
/>
>
)}
>
);
}