matt HOFFNER commited on
Commit
cd33332
·
1 Parent(s): 592db31
README.md CHANGED
@@ -1,6 +1,6 @@
1
  ---
2
- title: new google
3
- emoji: 📚
4
  colorFrom: yellow
5
  colorTo: indigo
6
  sdk: docker
@@ -8,43 +8,8 @@ app_port: 3000
8
  pinned: false
9
  ---
10
 
 
 
11
  This is a fork of https://github.com/sahandghavidel/google-clone-nextjs13
12
 
13
  This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
14
-
15
- ## Getting Started
16
-
17
- First, run the development server:
18
-
19
- ```bash
20
- npm run dev
21
- # or
22
- yarn dev
23
- # or
24
- pnpm dev
25
- ```
26
-
27
- Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
28
-
29
- You can start editing the page by modifying `app/page.js`. The page auto-updates as you edit the file.
30
-
31
- [API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.js`.
32
-
33
- The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
34
-
35
- This project uses [`next/font`](https://nextjs.org/docs/basic-features/font-optimization) to automatically optimize and load Inter, a custom Google Font.
36
-
37
- ## Learn More
38
-
39
- To learn more about Next.js, take a look at the following resources:
40
-
41
- - [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
42
- - [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
43
-
44
- You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
45
-
46
- ## Deploy on Vercel
47
-
48
- The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
49
-
50
- Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
 
1
  ---
2
+ title: google clone
3
+ emoji: 📚🎩
4
  colorFrom: yellow
5
  colorTo: indigo
6
  sdk: docker
 
8
  pinned: false
9
  ---
10
 
11
+ # 🎩 serp-chat 📚
12
+
13
  This is a fork of https://github.com/sahandghavidel/google-clone-nextjs13
14
 
15
  This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
src/components/HomeSearch.jsx CHANGED
@@ -3,7 +3,9 @@
3
  import { useState } from "react";
4
  import { useRouter } from "next/navigation";
5
  import { AiOutlineSearch } from "react-icons/ai";
6
- import { BsFillMicFill } from "react-icons/bs";
 
 
7
  export default function HomeSearch() {
8
  const router = useRouter();
9
  const [input, setInput] = useState("");
@@ -15,9 +17,9 @@ export default function HomeSearch() {
15
  }
16
  async function randomSearch() {
17
  setRandomSearchLoading(true);
 
18
  const response = await fetch("https://random-word-api.herokuapp.com/word")
19
  .then((res) => res.json())
20
- .then((data) => data[0]);
21
  if (!response) return;
22
  router.push(`/search/web?searchTerm=${response}`);
23
  setRandomSearchLoading(false);
 
3
  import { useState } from "react";
4
  import { useRouter } from "next/navigation";
5
  import { AiOutlineSearch } from "react-icons/ai";
6
+
7
+ const PresearchPrompt = "Please extract search terms from the user’s question. The search terms is a concise sentence, which will be searched on Google to obtain relevant information to answer the user’s question, too generalized search terms doesn’t help. Please provide no more than two search terms. Please provide the most relevant search terms only, the search terms should directly correspond to the user’s question. Please separate different search items with commas, with no quote marks. The user’s question is:"
8
+
9
  export default function HomeSearch() {
10
  const router = useRouter();
11
  const [input, setInput] = useState("");
 
17
  }
18
  async function randomSearch() {
19
  setRandomSearchLoading(true);
20
+ //
21
  const response = await fetch("https://random-word-api.herokuapp.com/word")
22
  .then((res) => res.json())
 
23
  if (!response) return;
24
  router.push(`/search/web?searchTerm=${response}`);
25
  setRandomSearchLoading(false);
src/components/WebSearchResults.jsx CHANGED
@@ -3,8 +3,13 @@ import Parser from "html-react-parser";
3
  import PaginationButtons from "./PaginationButtons";
4
 
5
  export default function WebSearchResults({ results }) {
 
 
6
  return (
7
  <div className="w-full mx-auto px-3 pb-40 sm:pb-24 sm:pl-[5%] md:pl-[14%] lg:pl-52">
 
 
 
8
  <div className="flex-grow">
9
  <p className="text-gray-600 text-sm mb-5 mt-3">
10
  About {results.searchInformation?.formattedTotalResults} results (
@@ -29,9 +34,6 @@ export default function WebSearchResults({ results }) {
29
  ))}
30
  <PaginationButtons />
31
  </div>
32
- <div className="w-1/4">
33
- <h1>Test</h1>
34
- </div>
35
  </div>
36
  );
37
  }
 
3
  import PaginationButtons from "./PaginationButtons";
4
 
5
  export default function WebSearchResults({ results }) {
6
+
7
+
8
  return (
9
  <div className="w-full mx-auto px-3 pb-40 sm:pb-24 sm:pl-[5%] md:pl-[14%] lg:pl-52">
10
+ <div className="w-1/4">
11
+ <h1>Test</h1>
12
+ </div>
13
  <div className="flex-grow">
14
  <p className="text-gray-600 text-sm mb-5 mt-3">
15
  About {results.searchInformation?.formattedTotalResults} results (
 
34
  ))}
35
  <PaginationButtons />
36
  </div>
 
 
 
37
  </div>
38
  );
39
  }