import { Head } from "$fresh/runtime.ts"; import { Handlers, PageProps } from "$fresh/server.ts"; import { RepoData, getRepos, searchRepos } from "../api/repo.ts"; import { useState } from "preact/hooks"; import { SearchBar } from "../components/SearchBar.tsx"; import RepoViewer from "../islands/RepoViewer.tsx"; import Search from "../islands/Search.tsx"; export const handler: Handlers = { GET: (req, ctx) => { const url = new URL(req.url); const searchParams = url.searchParams; const query = searchParams.get("q"); return ctx.render({query}) }, }; export default function Home({ data }: PageProps<{query?: string}>) { return ( <>