You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.3 KiB

import { useState } from "react";
3 years ago
import arrowIcon from "./arrow-icon.svg";
import more from "./more2.svg";
import edit from "./edit.svg";
3 years ago
export const Buttons = ({ row, addTab }) => {
3 years ago
const [activeDetails, setActiveDetails] = useState(null);
return (
3 years ago
<div className="flex flex-row items-center justify-end">
3 years ago
<div
className=""
onClick={() => {
console.log("mahdi");
setActiveDetails(!activeDetails);
}}
3 years ago
>
3 years ago
<button
className="mx-1 flex flex-row items-center justify-around p-2 rounded border border-gray-300"
{...row.getToggleRowExpandedProps()}
>
جزئیات
<img
// onClick={() => setActiveDetails(!activeDetails)}
src={arrowIcon}
alt=""
className={`mx-1 w-3 cursor-pointer mr-2 ${
activeDetails ? "rotate-60" : "rotate-90"
}`}
/>
</button>
</div>
3 years ago
<div
className="mx-1 p-2 rounded border border-gray-300 cursor-pointer"
onClick={() => {
addTab({ name: row.original.name, id: row.original.id });
}}
>
3 years ago
<img src={edit} alt="" className="w-4" />
</div>
<img src={more} alt="" className="w-5 cursor-pointer" />
3 years ago
</div>
);
3 years ago
};