${props.children}` as string }} className={`w-full h-10 leading-10 bg-zinc-100 hover:bg-zinc-300 dark:bg-zinc-800 hover:dark:bg-zinc-700 px-5 z-10 cursor-pointer duration-100`}>
);
}
\ No newline at end of file
diff --git a/components/search/onesearch/suggestionBox.tsx b/components/search/onesearch/suggestionBox.tsx
index bd40c52..70ca5aa 100644
--- a/components/search/onesearch/suggestionBox.tsx
+++ b/components/search/onesearch/suggestionBox.tsx
@@ -1,7 +1,7 @@
export default function(props: { children: React.ReactNode }) {
return (
-
+
{props.children}
);
diff --git a/components/search/search.tsx b/components/search/search.tsx
index 2ef1784..20064ff 100644
--- a/components/search/search.tsx
+++ b/components/search/search.tsx
@@ -3,13 +3,13 @@
import { useRecoilState, useRecoilValue } from "recoil";
import { settingsState } from "../state/settings";
import { useTranslations } from "next-intl";
-import { useState } from "react";
import { normalizeURL } from "@/lib/normalizeURL";
import validLink from "@/lib/url/validLink";
import { queryState } from "../state/query";
+import { settingsType } from "@/global";
export default function Search(props: { onFocus: () => void }) {
- const settings: settings = useRecoilValue(settingsState);
+ const settings: settingsType = useRecoilValue(settingsState);
const t = useTranslations("Search");
const [query, setQuery] = useRecoilState(queryState);
diff --git a/global.d.ts b/global.d.ts
index 0dc44c4..e23baee 100644
--- a/global.d.ts
+++ b/global.d.ts
@@ -1,6 +1,6 @@
import { Suggestion } from "search-engine-autocomplete";
-type settings = {
+type settingsType = {
version: number;
elementBackdrop: boolean;
bgBlur: boolean;
diff --git a/lib/getSearchEngineName.ts b/lib/getSearchEngineName.ts
new file mode 100644
index 0000000..7f8d58e
--- /dev/null
+++ b/lib/getSearchEngineName.ts
@@ -0,0 +1,17 @@
+import { engineTranslation } from "@/components/search/translatedEngineList";
+import { settingsState } from "@/components/state/settings";
+import { settingsType } from "@/global";
+import { useTranslations } from "next-intl";
+import { useRecoilValue } from "recoil";
+
+export default function(){
+ const settings: settingsType = useRecoilValue(settingsState);
+ const currentEngine = settings.currentSearchEngine;
+ const displayEngine = getName(currentEngine);
+ return displayEngine;
+}
+
+function getName(engineKey: string) {
+ const t = useTranslations("Search");
+ return engineTranslation.includes(engineKey) ? t(`engine.${engineKey}`) : engineKey;
+}
\ No newline at end of file
diff --git a/lib/version.ts b/lib/version.ts
index e8c665e..2916744 100644
--- a/lib/version.ts
+++ b/lib/version.ts
@@ -1,3 +1,3 @@
-export const SPARKHOME_VERSION="4.7.2";
-export const CLIENT_VERSION="4.7.1";
-export const NEXT_API_VERSION="4.7.1";
\ No newline at end of file
+export const SPARKHOME_VERSION="4.10.2";
+export const CLIENT_VERSION="4.10.2";
+export const NEXT_API_VERSION="4.10.1";
\ No newline at end of file
diff --git a/messages/en-US.json b/messages/en-US.json
index 6f79e09..f627d0c 100644
--- a/messages/en-US.json
+++ b/messages/en-US.json
@@ -10,7 +10,8 @@
"yandex": "Yandex",
"yahoo": "Yahoo",
"ecosia": "Ecosia"
- }
+ },
+ "search-help-text": "Search {engine}"
},
"404": {
"title": "Page Not Found"
diff --git a/messages/zh-CN.json b/messages/zh-CN.json
index 915fca0..117c08b 100644
--- a/messages/zh-CN.json
+++ b/messages/zh-CN.json
@@ -10,7 +10,8 @@
"yandex": "Yandex",
"yahoo": "雅虎",
"ecosia": "Ecosia"
- }
+ },
+ "search-help-text": "{engine} 搜索"
},
"404": {
"title": "未找到"
diff --git a/package.json b/package.json
index 4640652..0d0883b 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
{
"name": "sparkhome",
- "version": "4.10.0",
+ "version": "4.10.2",
"private": false,
"scripts": {
"dev": "next dev",