|
|
|
@ -113,6 +113,10 @@ const BasicTable = ({ |
|
|
|
|
[] |
|
|
|
|
); |
|
|
|
|
|
|
|
|
|
// console.log("mahdi tannaz");
|
|
|
|
|
// console.log(columns[0]);
|
|
|
|
|
// console.log("mahdi tannaz");
|
|
|
|
|
|
|
|
|
|
const defaultColumn = useMemo(() => { |
|
|
|
|
return {}; |
|
|
|
|
}, []); |
|
|
|
@ -163,7 +167,7 @@ const BasicTable = ({ |
|
|
|
|
const [activeList, setActiveList] = useState(false); |
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
|
<div className="bg-white p-4 rounded"> |
|
|
|
|
<div className="bg-white p-4"> |
|
|
|
|
{/* {filtering && <section>TANNAZ</section>} */} |
|
|
|
|
{/* <div className="flex flex-row items-center"> |
|
|
|
|
{listView.map((list, i) => ( |
|
|
|
@ -175,39 +179,41 @@ const BasicTable = ({ |
|
|
|
|
/> |
|
|
|
|
))} |
|
|
|
|
</div>{" "} */} |
|
|
|
|
<div className="mb-3 flex flex-row items-center gap-x-5"> |
|
|
|
|
<div className="mb-7 flex flex-row items-center justify-between"> |
|
|
|
|
{/* select View list */} |
|
|
|
|
<div className="flex flex-row items-center gap-x-2"> |
|
|
|
|
<img |
|
|
|
|
src={list} |
|
|
|
|
className="cursor-pointer" |
|
|
|
|
onClick={() => setActiveList(false)} |
|
|
|
|
/> |
|
|
|
|
<img |
|
|
|
|
src={grid} |
|
|
|
|
className="cursor-pointer" |
|
|
|
|
onClick={() => setActiveList(true)} |
|
|
|
|
<div className="flex flex-row items-center gap-x-5"> |
|
|
|
|
<div className="flex flex-row items-center gap-x-2"> |
|
|
|
|
<img |
|
|
|
|
src={list} |
|
|
|
|
className="cursor-pointer" |
|
|
|
|
onClick={() => setActiveList(false)} |
|
|
|
|
/> |
|
|
|
|
<img |
|
|
|
|
src={grid} |
|
|
|
|
className="cursor-pointer" |
|
|
|
|
onClick={() => setActiveList(true)} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
{headerGroups.map((headerGroup) => |
|
|
|
|
headerGroup.headers.map((column) => |
|
|
|
|
column.Filter ? ( |
|
|
|
|
<div className="mt-2 sm:mt-0" key={column.id}> |
|
|
|
|
{column.render("Filter")} |
|
|
|
|
</div> |
|
|
|
|
) : null |
|
|
|
|
) |
|
|
|
|
)} |
|
|
|
|
<ButtonNewDesign |
|
|
|
|
bgColor={"bg-blue-500"} |
|
|
|
|
icon={null} |
|
|
|
|
border={"border-0"} |
|
|
|
|
borderRadius={"rounded"} |
|
|
|
|
fontSize={"text-xs"} |
|
|
|
|
padding={"p-2"} |
|
|
|
|
text={"انتخاب چند فایل"} |
|
|
|
|
/> |
|
|
|
|
</div> |
|
|
|
|
{headerGroups.map((headerGroup) => |
|
|
|
|
headerGroup.headers.map((column) => |
|
|
|
|
column.Filter ? ( |
|
|
|
|
<div className="mt-2 sm:mt-0" key={column.id}> |
|
|
|
|
{column.render("Filter")} |
|
|
|
|
</div> |
|
|
|
|
) : null |
|
|
|
|
) |
|
|
|
|
)} |
|
|
|
|
<ButtonNewDesign |
|
|
|
|
bgColor={"bg-blue-500"} |
|
|
|
|
icon={null} |
|
|
|
|
border={"border-0"} |
|
|
|
|
borderRadius={"rounded"} |
|
|
|
|
fontSize={"text-xs"} |
|
|
|
|
padding={"p-2"} |
|
|
|
|
text={"انتخاب چند فایل"} |
|
|
|
|
/> |
|
|
|
|
<div className="flex-1 "> |
|
|
|
|
<div className="w-4/12 "> |
|
|
|
|
<GlobalFilter filter={globalFilter} setFilter={setGlobalFilter} /> |
|
|
|
|
</div> |
|
|
|
|
|
|
|
|
@ -282,7 +288,7 @@ const BasicTable = ({ |
|
|
|
|
{/* table LIST */} |
|
|
|
|
{activeTab == 0 ? ( |
|
|
|
|
<> |
|
|
|
|
{activeList === false && ( |
|
|
|
|
{activeList === true && ( |
|
|
|
|
// table
|
|
|
|
|
<table |
|
|
|
|
{...getTableProps()} |
|
|
|
@ -332,7 +338,7 @@ const BasicTable = ({ |
|
|
|
|
//
|
|
|
|
|
> |
|
|
|
|
{row.cells.map((cell, index) => { |
|
|
|
|
// console.log(row.cells);
|
|
|
|
|
console.log(row.cells); |
|
|
|
|
return ( |
|
|
|
|
<td |
|
|
|
|
{...cell.getCellProps({ |
|
|
|
@ -370,7 +376,7 @@ const BasicTable = ({ |
|
|
|
|
addTab={addTab} |
|
|
|
|
row={row.original} |
|
|
|
|
/> |
|
|
|
|
{/* {console.log(row.original)} */} |
|
|
|
|
{console.log(row.original)} |
|
|
|
|
</td> |
|
|
|
|
</tr> |
|
|
|
|
) : null} |
|
|
|
@ -381,7 +387,7 @@ const BasicTable = ({ |
|
|
|
|
</table> |
|
|
|
|
)} |
|
|
|
|
{/* GRID LIST */} |
|
|
|
|
{activeList === true && ( |
|
|
|
|
{activeList === false && ( |
|
|
|
|
<div |
|
|
|
|
{...getTableBodyProps()} |
|
|
|
|
className="flex flex-row flex-wrap gap-4 items-center justify-center" |
|
|
|
@ -395,6 +401,8 @@ const BasicTable = ({ |
|
|
|
|
key={index} |
|
|
|
|
style={{ backgroundColor: "#F3F3F3" }} |
|
|
|
|
> |
|
|
|
|
{/* {console.log(row.values)} */} |
|
|
|
|
<div className="bg-red-500"> {row.original.Checkbox}</div> |
|
|
|
|
<img |
|
|
|
|
src={row.original.filePic} |
|
|
|
|
alt={row.original.filePic} |
|
|
|
|