zkt26/Front-end/src/components/BoutonGraphique.jsx

26 lines
692 B
JavaScript

import React from "react";
import { ChartLine } from "lucide-react";
function BoutonGraphique({ type, setGraphStates, graphStates, graphCible }) {
const handleClick = () => {
setGraphStates((prev) => ({ ...prev, [type]: !prev[type] }));
};
return !graphStates[type] ? (
<button
className="bg-blue-200 py-2 my-2 px-4 rounded-full mr-2"
onClick={handleClick}
>
<ChartLine className="text-indigo-600" size={24} />
</button>
) : (
<button
className="bg-blue-400 py-2 my-2 px-4 rounded-full mr-2"
onClick={handleClick}
>
<ChartLine className="text-indigo-600" size={24} />
</button>
);
}
export default BoutonGraphique;