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 "./components/navigationMenu"; import { RepositoryCarousel } from "./components/repositoryCarousel"; import { SearchBar } from "./components/searchBar"; import { Separator } from "@/components/ui/separator"; import { SymbolIcon } from "@radix-ui/react-icons"; import { UpgradeToast } from "./components/upgradeToast"; import Link from "next/link"; import { getOrgFromDomain } from "@/data/org"; import { PageNotFound } from "./components/pageNotFound"; export default async function Home({ params: { domain } }: { params: { domain: string } }) { const org = await getOrgFromDomain(domain); if (!org) { return } return (
{"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) rev:HEAD (by branch or tag) 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 ({ orgId, domain }: { orgId: number, domain: string }) => { const _repos = await listRepositories(orgId); if (isServiceError(_repos)) { return null; } const repos = _repos.List.Repos.map((repo) => repo.Repository); if (repos.length === 0) { return (
indexing in progress...
) } 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} ) }