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.
43 lines
1.2 KiB
43 lines
1.2 KiB
import React, { useState } from "react"; |
|
import Table from "./BasicTable"; |
|
|
|
import DropDown from "./DropDown"; |
|
|
|
import filter from "./filter.svg"; |
|
import plus from "./plus.svg"; |
|
|
|
export function EditButtons({ setFiltering, filtering, addTab }) { |
|
const [selectedFilterRow, setSelectedFilterRow] = useState(filtering); |
|
|
|
return ( |
|
<div className="flex flex-row items-center justify-end"> |
|
{/* add new row */} |
|
<button |
|
className="mx-1 flex flex-row items-center p-2 text-xs text-white rounded border-b-2 border-blue-600" |
|
style={{ backgroundColor: "#65A9FF" }} |
|
onClick={() => { |
|
console.log("new!!!"); |
|
addTab({ id: "new", name: "ردیف جدید" }); |
|
}} |
|
> |
|
ثبت جدید |
|
<img src={plus} alt="" className={`cursor-pointer w-2 mr-1 `} /> |
|
</button> |
|
{/* filter */} |
|
<img |
|
src={filter} |
|
alt="" |
|
className={`mx-1 p-2 rounded border border-blue-300 cursor-pointer w-8 |
|
${selectedFilterRow ? "border" : "border-0"}`} |
|
onClick={() => { |
|
setFiltering(!selectedFilterRow); |
|
setSelectedFilterRow(!selectedFilterRow); |
|
}} |
|
/> |
|
{/* dropDown */} |
|
<DropDown /> |
|
</div> |
|
); |
|
} |
|
|
|
EditButtons.defaultProps = {};
|
|
|