Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
bekzodjonganiyev committed Jan 30, 2023
1 parent e4bf28c commit 903a3f0
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/pages/nashriyot/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ const NashriyotComponent = () =>{
DataGetter(setNashriyot, 'matbuot/all')
},[]);

const [search, setSearch] = useState()


const TableHead = about[lang];
const TableContent = (item, index) => <th key={index}>{item}</th>
const TableBody = nashriyot.data;
Expand All @@ -55,7 +58,10 @@ const NashriyotComponent = () =>{
<h2 className="cardTitleComp">{hero[lang].title}</h2>
{
nashriyot.isFetched && nashriyot.data ? (
<Table headData={TableHead} renderHead={TableContent} renderBody={TableRender} bodyData={TableBody} />
<>
<input type="text" className="form-control" value={search} onChange={(e) => setSearch(e.target.value)} />
<Table headData={TableHead} renderHead={TableContent} renderBody={TableRender} bodyData={TableBody} search={search} />
</>
):(
<></>
)
Expand Down
8 changes: 6 additions & 2 deletions src/pages/sertifikat.js/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ const SertifikatComponent = () =>{
useEffect(()=>{
DataGetter(setSertifikat, 'sertifikat/all')
},[]);

const [search, setSearch] = useState()
const TableHead = about[lang];
const TableContent = (item, index) => <th key={index}>{item}</th>
const TableBody = sertifikat.data;
Expand All @@ -54,7 +54,11 @@ const SertifikatComponent = () =>{
<h2 className="cardTitleComp">{hero[lang].title}</h2>
{
sertifikat.isFetched && sertifikat.data ? (
<Table headData={TableHead} renderHead={TableContent} renderBody={TableRender} bodyData={TableBody} />
<>
<input type="text" className="form-control" value={search} onChange={(e) => setSearch(e.target.value)} />
<Table headData={TableHead} renderHead={TableContent} renderBody={TableRender} bodyData={TableBody} search={search} />

</>
):(
<></>
)
Expand Down

0 comments on commit 903a3f0

Please sign in to comment.