Update OptionLayout component and add OptionPrompt route

This commit is contained in:
n4ze3m
2024-02-28 22:50:38 +05:30
parent 4365580f5d
commit 88e7e7521b
7 changed files with 401 additions and 7 deletions

View File

@@ -40,7 +40,14 @@ export const localGoogleSearch = async (query: string) => {
(result) => {
const title = result.querySelector("h3")?.textContent
const link = result.querySelector("a")?.getAttribute("href")
return { title, link }
let content = result.querySelector("div[data-sncf='2']")?.textContent
if(content === "") {
content = result.querySelector("div[data-sncf='1']")?.textContent
if(content === "") {
content = result.querySelector("div[data-sncf='3']")?.textContent
}
}
return { title, link, content }
}
)
const filteredSearchResults = searchResults