import React, { useState } from "react"; import filter from "./filter.svg"; import plus from "./plus.svg"; import more from "./more2.svg"; import DropDown from "./DropDown"; export function EditButtons({ buttons }) { const [selectedButton, setSelectedButton] = useState(null); return (
{buttons.map((button, index) => (
setSelectedButton(selectedButton === button ? null : button) } >

{button.title}

))}
{selectedButton?.components}
); } EditButtons.defaultProps = { buttons: [ { logo: plus, width: "w-3", height: "h-3", title: "ثبت جدید", backgroundColor: "#65A9FF", border: "border-b-4", borderColor: "#3686EC", padding: "4px 7px", // components: "d", }, { logo: filter, width: "w-5", height: "h-5", title: null, backgroundColor: "#F3F8FF", border: null, borderColor: null, // components: "a", }, { logo: more, width: "w-5", height: "h-5", title: null, textColor: null, backgroundColor: "#F3F8FF", border: null, borderColor: null, // components: , }, ], };