import { Popover } from '@headlessui/react' import { classNames } from '@app/utils/classes' import { PropsWithChildren, useMemo } from 'react' import { AllWebsitesList } from './website/all-websites-list' import { useInteractiveContext } from '../providers/interactive' import { GrStatusGoodSmall } from 'react-icons/gr' type ViewConfigTitleProps = { title?: string className?: string } // determine layout for view one of all or selected website todo function ViewConfigTitle({ title = '', children, className = '', }: PropsWithChildren) { const { selectedWebsite } = useInteractiveContext() const pageTitle = useMemo(() => { // todo: set hostname on event instead if (selectedWebsite) { try { return new URL(selectedWebsite).hostname } catch (e) { console.error(e) } } }, [selectedWebsite]) return (
<>
{pageTitle || title}
{children}
) } export { ViewConfigTitle }