import { Badge } from "~/components/ui/badge" import { ScrollArea } from "~/components/ui/scroll-area" import type { AnswersQuery } from "~/generated/graphql" import { cn } from "~/lib/utils" type AnswerListProps = { items: NonNullable["answers"]> } export function AnswerList({ items }: AnswerListProps) { return ( {0 < items.length ? (
{items.map((item) => (
{item.question}
{(item.categoryMajor ?? item.categoryMinor ?? item.categoryMedium) && (
{item.categoryMajor && ( {item.categoryMajor} )} {item.categoryMedium && ( {item.categoryMedium} )}
)}
))}
) : (

ヒント:

  • 児童手当の申請期限を教えてください
  • マイナンバーカードに記載されている電子証明書とは?
  • 年金は「いつから」「いくら」受け取れますか?
)}
) } // FIXME: This function is not safe. It should be replaced with a safer // implementation. function unsafeConvertToAnchorTag(inputText: string) { const regex = /<([^,]+),(http[^>]+)>/g return inputText.replace(regex, (_match, text, url) => { const escapedText = text .replace(/&/g, "&") .replace(//g, ">") .replace(/"/g, """) return `${escapedText.trim()}` }) }