2025-09-21 11:02:31 -07:00
|
|
|
"use client";
|
2025-08-28 14:15:36 +01:00
|
|
|
|
2026-01-15 13:09:34 +00:00
|
|
|
import type { ComponentProps } from "react";
|
2025-09-21 11:02:31 -07:00
|
|
|
import { Streamdown } from "streamdown";
|
|
|
|
|
import { cn } from "@/lib/utils";
|
2025-08-28 14:15:36 +01:00
|
|
|
|
|
|
|
|
type ResponseProps = ComponentProps<typeof Streamdown>;
|
|
|
|
|
|
2026-01-15 16:06:42 +00:00
|
|
|
export function Response({ className, children, ...props }: ResponseProps) {
|
|
|
|
|
return (
|
|
|
|
|
<Streamdown
|
|
|
|
|
className={cn(
|
|
|
|
|
"size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0 [&_code]:whitespace-pre-wrap [&_code]:break-words [&_pre]:max-w-full [&_pre]:overflow-x-auto",
|
|
|
|
|
className
|
|
|
|
|
)}
|
|
|
|
|
{...props}
|
|
|
|
|
>
|
|
|
|
|
{children}
|
|
|
|
|
</Streamdown>
|
|
|
|
|
);
|
|
|
|
|
}
|