NeoPy's picture
Upload folder using huggingface_hub
867b17d verified
raw
history blame
733 Bytes
'use client';
import { cn } from '@/lib/utils';
import { type ComponentProps, memo } from 'react';
import { Streamdown } from 'streamdown';
type ResponseProps = ComponentProps<typeof Streamdown>;
export const Response = memo(
({ className, ...props }: ResponseProps) => (
<Streamdown
className={cn(
'size-full [&>*:first-child]:mt-0 [&>*:last-child]:mb-0',
className,
)}
components={{
code: ({ children, className, ...props }) => (
<code className={className} {...props}>
{children}
</code>
),
}}
{...props}
/>
),
(prevProps, nextProps) => prevProps.children === nextProps.children,
);
Response.displayName = 'Response';