import { listRepositories } from "@/lib/server/searchService"; import { isServiceError } from "@/lib/utils"; import Image from "next/image"; import { Suspense } from "react"; import logoDark from "../../public/sb_logo_dark_large.png"; import logoLight from "../../public/sb_logo_light_large.png"; import { NavigationMenu } from "./navigationMenu"; import { RepositoryCarousel } from "./repositoryCarousel"; import { SearchBar } from "./searchBar"; import { Separator } from "@/components/ui/separator"; export default async function Home() { return (
{/* TopBar */}
{"Sourcebot {"Sourcebot
...
}>
How to search
test todo (both test and todo) test or todo (either test or todo) {`"exit boot"`} (exact match) TODO case:yes (case sensitive) file:README setup (by filename) repo:torvalds/linux test (by repo) lang:typescript (by language) branch:HEAD (by branch) file:{`\\.py$`} {`(files that end in ".py")`} sym:main {`(symbols named "main")`} todo -lang:c (negate filter) content:README (search content only)
) } const RepositoryList = async () => { const _repos = await listRepositories(); if (isServiceError(_repos)) { return null; } const repos = _repos.List.Repos.map((repo) => repo.Repository); if (repos.length === 0) { return Get started {` configuring Sourcebot.`} ; } return (
{`Search ${repos.length} `} {repos.length > 1 ? 'repositories' : 'repository'}
) } const HowToSection = ({ title, children }: { title: string, children: React.ReactNode }) => { return (
{title} {children}
) } const Highlight = ({ children }: { children: React.ReactNode }) => { return ( {children} ) } const QueryExample = ({ children }: { children: React.ReactNode }) => { return ( {children} ) } const QueryExplanation = ({ children }: { children: React.ReactNode }) => { return ( {children} ) } const Query = ({ query, children }: { query: string, children: React.ReactNode }) => { return ( {children} ) }