import { useMediaQuery } from "@uidotdev/usehooks" import { Search } from "lucide-react" import { useState } from "react" import { useQuery } from "urql" import { AnswerList } from "~/components/answer-list" import { AnswerSummary } from "~/components/answer-summary" import { QAHelp } from "~/components/qa-help" import { QuestionSearch } from "~/components/question-search" import { CommandDialog } from "~/components/ui/command" import { ResizableHandle, ResizablePanel, ResizablePanelGroup, } from "~/components/ui/resizable" import { Separator } from "~/components/ui/separator" import { TooltipProvider } from "~/components/ui/tooltip" import { graphql } from "~/generated/gql" import { cn } from "~/lib/utils" const AnswersQuery = graphql(` query answers($query: String) { answers(query: $query) { answers { id docId categoryMajor categoryMedium categoryMinor question answer score } } } `) export function QA() { const isMobile = useMediaQuery("only screen and (max-width : 768px)") const defaultLayout = [60, 40] const [open, setOpen] = useState(true) const [question, setQuestion] = useState("") const [result, _reexecuteQuery] = useQuery({ query: AnswersQuery, variables: { query: question }, }) const { data, fetching, error } = result return (

Govsearch

{error ?

Oh no... {error.message}

: null} {!(fetching || error) && ( )}
) }