'use client' import { FC, useMemo } from 'react' import { Fab } from './fab' import { Link } from './link' import { GrClose } from 'react-icons/gr' import { Lighthouse } from './lighthouse' import { AccessIframe } from '../ada/access-iframe' import { Button } from './buttons' import { HeadlessModal } from '../modal/headless' import { useInteractiveContext } from '../providers/interactive' // a mini modal that appears that can be dragged across the screen. export const MiniPlayer: FC = () => { const { miniPlayer, setMiniPlayerContent } = useInteractiveContext() const { open, data, title } = useMemo(() => { // parse lighthouse data if (miniPlayer && miniPlayer?.title === 'Lighthouse') { return { ...miniPlayer, data: miniPlayer?.data ? JSON.parse(miniPlayer.data) : null, } } return miniPlayer }, [miniPlayer]) const onModalCloseEvent = () => { setMiniPlayerContent(false) } return (

{title}

{data && title !== 'Lighthouse' ? (
{data}
) : null}
{title === 'Lighthouse' ? ( <> {data && 'json' in data ? ( ) : (
Light house data not found.
)} ) : (
)}
) }