/* eslint-disable @next/next/no-img-element */ import { Dialog, DialogPanel, DialogTitle, Transition, TransitionChild, } from '@headlessui/react'; import { Document } from '@langchain/core/documents'; import { Fragment, useState } from 'react'; const MessageSources = ({ sources }: { sources: Document[] }) => { const [isDialogOpen, setIsDialogOpen] = useState(false); const closeModal = () => { setIsDialogOpen(false); document.body.classList.remove('overflow-hidden-scrollable'); }; const openModal = () => { setIsDialogOpen(true); document.body.classList.add('overflow-hidden-scrollable'); }; return (
{sources.slice(0, 3).map((source, i) => (

{source.metadata.title}

favicon

{source.metadata.url.replace(/.+\/\/|www.|\..+/g, '')}

{i + 1}
))} {sources.length > 3 && ( )}
); }; export default MessageSources;