From 9b12df5d9d1fbd5dbef33f75cf0844e0dab2b1d3 Mon Sep 17 00:00:00 2001 From: Damla Koksal Date: Mon, 25 Apr 2022 21:22:17 +0300 Subject: [PATCH] [#25]feat: add new word to db --- .../Dashboard/modules/Table/Search/Search.tsx | 9 ++-- .../layouts/Dashboard/modules/Table/Table.tsx | 6 +-- src/context/Search/searchContext.tsx | 54 +++++++++---------- src/interfaces/pages/dashboard.d.ts | 1 + src/lib/prisma/seed.ts | 2 + 5 files changed, 37 insertions(+), 35 deletions(-) diff --git a/src/components/layouts/Dashboard/modules/Table/Search/Search.tsx b/src/components/layouts/Dashboard/modules/Table/Search/Search.tsx index f06b012..caec72a 100644 --- a/src/components/layouts/Dashboard/modules/Table/Search/Search.tsx +++ b/src/components/layouts/Dashboard/modules/Table/Search/Search.tsx @@ -1,4 +1,4 @@ -import { useEffect, useState } from 'react'; +import { useState } from 'react'; import { Icon } from '../../../../../common'; import { Icons } from '../../../../../common/Icon/Icon'; import { useSearch } from '../../../../../../hooks/useSearch'; @@ -9,6 +9,7 @@ interface Props { col1: string; col2: string; search: string; + searchBy: string; }; } @@ -17,9 +18,9 @@ const enum Filter { TO = 'TO', } -const Search = ({ data: { col1, col2, search } }: Props) => { +const Search = ({ data: { col1, col2, search, searchBy } }: Props) => { const [current, setCurrent] = useState(Filter.FROM); - const { data, dataLoading, query, addQuery } = useSearch(); + const { query, addQuery } = useSearch(); useEffect(() => { !dataLoading && console.log('hay amk:', data); @@ -31,7 +32,7 @@ const Search = ({ data: { col1, col2, search } }: Props) => {
- Search by: + {searchBy}