File tree Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Expand file tree Collapse file tree 1 file changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -3,6 +3,24 @@ import {useState} from "react";
3
3
import { useLanguage } from '../i18n/LanguageContext' ;
4
4
import { handleFuzzy } from "../utils/FuzzyMatching" ;
5
5
6
+ /**
7
+ * Renders a search box with fuzzy matching autocompletion and settings panel.
8
+ *
9
+ * The component renders a text input field that triggers a fuzzy matching
10
+ * search when the user types. The fuzzy matching results are displayed in a
11
+ * dropdown box below the input field. The user can select a result from the
12
+ * dropdown to prefill the input field.
13
+ *
14
+ * The component also renders a settings panel that allows the user to adjust
15
+ * the number of results and the fuzzy matching accuracy threshold. The panel
16
+ * is initially hidden and can be toggled on and off by clicking on the
17
+ * settings icon.
18
+ *
19
+ * @param {string } source - The source language for the fuzzy matching search.
20
+ * @param {string } API_URL - The base URL of the translation API.
21
+ * @param {function } setInputSearch - Callback to set the input search term.
22
+ * @returns {React.ReactElement } - The rendered search box component.
23
+ */
6
24
function SearchBox ( source , API_URL , setInputSearch ) {
7
25
const { translate } = useLanguage ( ) ;
8
26
You can’t perform that action at this time.
0 commit comments