2
0
visuddhinanda 2 жил өмнө
parent
commit
8240dab066

+ 3 - 4
dashboard/src/components/fts/FullSearchInput.tsx

@@ -2,6 +2,7 @@ import { AutoComplete, Badge, Input, Select, Space, Typography } from "antd";
 import { SizeType } from "antd/lib/config-provider/SizeContext";
 import { SizeType } from "antd/lib/config-provider/SizeContext";
 import { useState } from "react";
 import { useState } from "react";
 import { get } from "../../request";
 import { get } from "../../request";
+import { ISearchView } from "./FullTextSearchResult";
 
 
 const { Text } = Typography;
 const { Text } = Typography;
 const { Option } = Select;
 const { Option } = Select;
@@ -32,8 +33,7 @@ interface IWidget {
   para?: number;
   para?: number;
   size?: SizeType;
   size?: SizeType;
   width?: string | number;
   width?: string | number;
-  searchPage?: boolean;
-  view?: string;
+  view?: ISearchView;
   onSearch?: Function;
   onSearch?: Function;
   onSplit?: Function;
   onSplit?: Function;
   onPageTypeChange?: Function;
   onPageTypeChange?: Function;
@@ -46,7 +46,6 @@ const FullSearchInputWidget = ({
   width,
   width,
   onSearch,
   onSearch,
   view = "pali",
   view = "pali",
-  searchPage = false,
   onPageTypeChange,
   onPageTypeChange,
 }: IWidget) => {
 }: IWidget) => {
   const [options, setOptions] = useState<ValueType[]>([]);
   const [options, setOptions] = useState<ValueType[]>([]);
@@ -112,7 +111,7 @@ const FullSearchInputWidget = ({
   );
   );
   return (
   return (
     <Space>
     <Space>
-      {searchPage ? selectBefore : undefined}
+      {view === "page" ? selectBefore : undefined}
       <AutoComplete
       <AutoComplete
         style={{ width: width }}
         style={{ width: width }}
         value={input}
         value={input}