import { Image } from '@nextui-org/image' import { useFetchWebMetadata } from '@/hooks/useFetchWebMetadata' import { cn } from '@/lib/utils' import { useMemo } from 'react' export default function WebPreview({ url, className, size = 'normal' }: { url: string className?: string size?: 'normal' | 'small' }) { const { title, description, image } = useFetchWebMetadata(url) const hostname = useMemo(() => { try { return new URL(url).hostname } catch { return '' } }, [url]) if (!title) { return null } return (