|
|
|
@ -1,5 +1,7 @@ |
|
|
|
|
import React, { useMemo } from "react"; |
|
|
|
|
|
|
|
|
|
import "./index.scss"; |
|
|
|
|
|
|
|
|
|
import { |
|
|
|
|
useTable, |
|
|
|
|
useSortBy, |
|
|
|
@ -36,7 +38,7 @@ export function SelectColumnFilter({ |
|
|
|
|
<label className="flex gap-x-2 items-baseline"> |
|
|
|
|
<span className="text-gray-700">{render("Header")}: </span> |
|
|
|
|
<select |
|
|
|
|
className="rounded-md border-gray-300 shadow-sm focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50" |
|
|
|
|
className="rounded-md border-gray-300 shadow-sm text-xs focus:border-indigo-300 focus:ring focus:ring-indigo-200 focus:ring-opacity-50" |
|
|
|
|
name={id} |
|
|
|
|
id={id} |
|
|
|
|
value={filterValue} |
|
|
|
@ -44,7 +46,7 @@ export function SelectColumnFilter({ |
|
|
|
|
setFilter(e.target.value || undefined) |
|
|
|
|
}} |
|
|
|
|
> |
|
|
|
|
<option value="">همه</option> |
|
|
|
|
<option className="text-xs" value="">همه</option> |
|
|
|
|
{options.map((option, i) => ( |
|
|
|
|
<option key={i} value={option} className="text-xs"> |
|
|
|
|
{(() => { |
|
|
|
@ -156,15 +158,17 @@ const BasicTable = () => { |
|
|
|
|
console.log(rows.length); |
|
|
|
|
return ( |
|
|
|
|
<> |
|
|
|
|
{headerGroups.map((headerGroup) => |
|
|
|
|
<div className="customeClass1"> |
|
|
|
|
{headerGroups.map((headerGroup) => |
|
|
|
|
headerGroup.headers.map((column) => |
|
|
|
|
column.Filter ? ( |
|
|
|
|
<div className="mt-2 sm:mt-0" key={column.id}> |
|
|
|
|
<div className="mt-2 sm:mt-0 customeClass2" key={column.id}> |
|
|
|
|
{column.render("Filter")} |
|
|
|
|
</div> |
|
|
|
|
) : null |
|
|
|
|
) |
|
|
|
|
)} |
|
|
|
|
</div> |
|
|
|
|
<div className="flex flex-row items-center justify-between mb-3 mx-4"> |
|
|
|
|
{/* search box */} |
|
|
|
|
<GlobalFilter filter={globalFilter} setFilter={setGlobalFilter} /> |
|
|
|
|