-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
43 changed files
with
38,379 additions
and
469 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import Link from "next/link"; | ||
import { Card, CardContent } from "@/components/ui/card"; | ||
import { Button } from "@/components/ui/button"; | ||
import { HomeIcon } from "lucide-react"; | ||
|
||
export default function NotFound() { | ||
return ( | ||
<div className="min-h-screen flex flex-col items-center justify-center p-4"> | ||
<Card className="w-full max-w-md"> | ||
<CardContent className="pt-6 text-center"> | ||
<div className="mb-6"> | ||
<h1 className="text-4xl font-bold mb-2">404</h1> | ||
<p className="text-muted-foreground"> | ||
Oops! The page you're looking for doesn't exist. | ||
</p> | ||
</div> | ||
<Link href="/"> | ||
<Button | ||
variant="default" | ||
className="gap-2 bg-black text-white hover:bg-black/70" | ||
> | ||
<HomeIcon className="h-4 w-4" /> | ||
Back to Home | ||
</Button> | ||
</Link> | ||
</CardContent> | ||
</Card> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function SourcesPage() { | ||
return <div>SourcesPage</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export default function SummaryPage() { | ||
return <div>SummaryPage</div>; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { createStringFromParam } from "@/lib/create-param-from-string"; | ||
|
||
export default async function PrototypeLayout({ | ||
children, | ||
|
||
...props | ||
}: { | ||
children: React.ReactNode; | ||
sources: React.ReactNode; | ||
summary: React.ReactNode; | ||
params: Promise<{ query?: string }>; | ||
}) { | ||
const params = await props.params; | ||
const query = params.query; | ||
const searchPrompt = createStringFromParam(query!); | ||
|
||
return ( | ||
<main className="flex-grow flex justify-center p-4"> | ||
<div className="w-full max-w-4xl space-y-6"> | ||
<h1 className="text-3xl font-bold">{searchPrompt}</h1> | ||
{children} | ||
</div> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
import { SourcesSkeleton } from "./sources-skeleton"; | ||
import { StreamingSummarySkeleton } from "./streaming-summary-skeleton"; | ||
|
||
export default function Loading() { | ||
return ( | ||
<> | ||
<SourcesSkeleton /> | ||
<StreamingSummarySkeleton /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
import { createStringFromParam } from "@/lib/create-param-from-string"; | ||
import { processSearchResults } from "@/lib/processSearchResults"; | ||
import { SearchTool } from "@/lib/SearchTool"; | ||
import { Metadata } from "next"; | ||
import { Sources } from "./sources"; | ||
import { StreamingSummary } from "./streaming-summary"; | ||
|
||
export const metadata: Metadata = { | ||
title: "Prototype Page", | ||
description: "A basic Next.js prototype page", | ||
}; | ||
|
||
export default async function PrototypePage(props: { | ||
params: Promise<{ query?: string }>; | ||
}) { | ||
const params = await props.params; | ||
const query = params.query; | ||
const searchPrompt = createStringFromParam(query!); | ||
|
||
const searchTool = new SearchTool(); | ||
const searchResults = await searchTool.search(searchPrompt!).then(); | ||
const processedResults = processSearchResults(searchResults!); | ||
|
||
return ( | ||
<> | ||
<Sources sources={processedResults.slice(0, 4)} /> | ||
<StreamingSummary query={searchPrompt} sources={processedResults} /> | ||
</> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { Card, CardContent } from "@/components/ui/card"; | ||
import { Skeleton } from "@/components/ui/skeleton"; | ||
|
||
export function SourcesSkeleton() { | ||
return ( | ||
<div className="w-full space-y-4"> | ||
<h2 className="text-2xl font-semibold">Sources</h2> | ||
<div className="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-4"> | ||
{Array.from({ length: 4 }).map((_, index) => ( | ||
<Card key={index} className="overflow-hidden"> | ||
<CardContent className="p-4 h-full flex flex-col justify-between"> | ||
<div className="space-y-2"> | ||
<div className="flex items-start justify-between"> | ||
<Skeleton className="h-5 w-3/4" /> | ||
<Skeleton className="h-5 w-5 rounded-sm" /> | ||
</div> | ||
<div className="space-y-1"> | ||
<Skeleton className="h-3 w-full" /> | ||
<Skeleton className="h-3 w-4/5" /> | ||
</div> | ||
</div> | ||
<div className="flex items-center justify-between mt-4"> | ||
<Skeleton className="h-3 w-24" /> | ||
<Skeleton className="h-3 w-16" /> | ||
</div> | ||
</CardContent> | ||
</Card> | ||
))} | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; | ||
import { FileText } from "lucide-react"; | ||
|
||
export const StreamingSummarySkeleton = () => { | ||
return ( | ||
<Card className="w-full mt-10"> | ||
<CardHeader> | ||
<CardTitle className="flex items-center gap-2 text-lg font-semibold"> | ||
<FileText className="w-5 h-5" /> | ||
Summary | ||
</CardTitle> | ||
</CardHeader> | ||
<CardContent> | ||
<div className="mb-4"> | ||
<div className="w-24 h-6 bg-muted animate-pulse rounded-full" /> | ||
</div> | ||
<div className="space-y-3"> | ||
<div className="h-4 bg-muted animate-pulse rounded" /> | ||
<div className="h-4 bg-muted animate-pulse rounded w-[95%]" /> | ||
<div className="h-4 bg-muted animate-pulse rounded w-[90%]" /> | ||
<div className="h-4 bg-muted animate-pulse rounded w-[85%]" /> | ||
</div> | ||
</CardContent> | ||
</Card> | ||
); | ||
}; |
Oops, something went wrong.