|
|
@ -113,6 +113,10 @@ const BasicTable = ({ |
|
|
|
[] |
|
|
|
[] |
|
|
|
); |
|
|
|
); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log("mahdi tannaz");
|
|
|
|
|
|
|
|
// console.log(columns[0]);
|
|
|
|
|
|
|
|
// console.log("mahdi tannaz");
|
|
|
|
|
|
|
|
|
|
|
|
const defaultColumn = useMemo(() => { |
|
|
|
const defaultColumn = useMemo(() => { |
|
|
|
return {}; |
|
|
|
return {}; |
|
|
|
}, []); |
|
|
|
}, []); |
|
|
@ -163,7 +167,7 @@ const BasicTable = ({ |
|
|
|
const [activeList, setActiveList] = useState(false); |
|
|
|
const [activeList, setActiveList] = useState(false); |
|
|
|
|
|
|
|
|
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<div className="bg-white p-4 rounded"> |
|
|
|
<div className="bg-white p-4"> |
|
|
|
{/* {filtering && <section>TANNAZ</section>} */} |
|
|
|
{/* {filtering && <section>TANNAZ</section>} */} |
|
|
|
{/* <div className="flex flex-row items-center"> |
|
|
|
{/* <div className="flex flex-row items-center"> |
|
|
|
{listView.map((list, i) => ( |
|
|
|
{listView.map((list, i) => ( |
|
|
@ -175,39 +179,41 @@ const BasicTable = ({ |
|
|
|
/> |
|
|
|
/> |
|
|
|
))} |
|
|
|
))} |
|
|
|
</div>{" "} */} |
|
|
|
</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 */} |
|
|
|
{/* select View list */} |
|
|
|
<div className="flex flex-row items-center gap-x-2"> |
|
|
|
<div className="flex flex-row items-center gap-x-5"> |
|
|
|
<img |
|
|
|
<div className="flex flex-row items-center gap-x-2"> |
|
|
|
src={list} |
|
|
|
<img |
|
|
|
className="cursor-pointer" |
|
|
|
src={list} |
|
|
|
onClick={() => setActiveList(false)} |
|
|
|
className="cursor-pointer" |
|
|
|
/> |
|
|
|
onClick={() => setActiveList(false)} |
|
|
|
<img |
|
|
|
/> |
|
|
|
src={grid} |
|
|
|
<img |
|
|
|
className="cursor-pointer" |
|
|
|
src={grid} |
|
|
|
onClick={() => setActiveList(true)} |
|
|
|
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> |
|
|
|
</div> |
|
|
|
{headerGroups.map((headerGroup) => |
|
|
|
<div className="w-4/12 "> |
|
|
|
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 "> |
|
|
|
|
|
|
|
<GlobalFilter filter={globalFilter} setFilter={setGlobalFilter} /> |
|
|
|
<GlobalFilter filter={globalFilter} setFilter={setGlobalFilter} /> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
|
|
|
@ -282,7 +288,7 @@ const BasicTable = ({ |
|
|
|
{/* table LIST */} |
|
|
|
{/* table LIST */} |
|
|
|
{activeTab == 0 ? ( |
|
|
|
{activeTab == 0 ? ( |
|
|
|
<> |
|
|
|
<> |
|
|
|
{activeList === false && ( |
|
|
|
{activeList === true && ( |
|
|
|
// table
|
|
|
|
// table
|
|
|
|
<table |
|
|
|
<table |
|
|
|
{...getTableProps()} |
|
|
|
{...getTableProps()} |
|
|
@ -332,7 +338,7 @@ const BasicTable = ({ |
|
|
|
//
|
|
|
|
//
|
|
|
|
> |
|
|
|
> |
|
|
|
{row.cells.map((cell, index) => { |
|
|
|
{row.cells.map((cell, index) => { |
|
|
|
// console.log(row.cells);
|
|
|
|
console.log(row.cells); |
|
|
|
return ( |
|
|
|
return ( |
|
|
|
<td |
|
|
|
<td |
|
|
|
{...cell.getCellProps({ |
|
|
|
{...cell.getCellProps({ |
|
|
@ -370,7 +376,7 @@ const BasicTable = ({ |
|
|
|
addTab={addTab} |
|
|
|
addTab={addTab} |
|
|
|
row={row.original} |
|
|
|
row={row.original} |
|
|
|
/> |
|
|
|
/> |
|
|
|
{/* {console.log(row.original)} */} |
|
|
|
{console.log(row.original)} |
|
|
|
</td> |
|
|
|
</td> |
|
|
|
</tr> |
|
|
|
</tr> |
|
|
|
) : null} |
|
|
|
) : null} |
|
|
@ -381,7 +387,7 @@ const BasicTable = ({ |
|
|
|
</table> |
|
|
|
</table> |
|
|
|
)} |
|
|
|
)} |
|
|
|
{/* GRID LIST */} |
|
|
|
{/* GRID LIST */} |
|
|
|
{activeList === true && ( |
|
|
|
{activeList === false && ( |
|
|
|
<div |
|
|
|
<div |
|
|
|
{...getTableBodyProps()} |
|
|
|
{...getTableBodyProps()} |
|
|
|
className="flex flex-row flex-wrap gap-4 items-center justify-center" |
|
|
|
className="flex flex-row flex-wrap gap-4 items-center justify-center" |
|
|
@ -395,6 +401,8 @@ const BasicTable = ({ |
|
|
|
key={index} |
|
|
|
key={index} |
|
|
|
style={{ backgroundColor: "#F3F3F3" }} |
|
|
|
style={{ backgroundColor: "#F3F3F3" }} |
|
|
|
> |
|
|
|
> |
|
|
|
|
|
|
|
{/* {console.log(row.values)} */} |
|
|
|
|
|
|
|
<div className="bg-red-500"> {row.original.Checkbox}</div> |
|
|
|
<img |
|
|
|
<img |
|
|
|
src={row.original.filePic} |
|
|
|
src={row.original.filePic} |
|
|
|
alt={row.original.filePic} |
|
|
|
alt={row.original.filePic} |
|
|
|