import { useEffect } from "preact/hooks";

interface Props {
    children: unknown;
}
export const Title = ({ children }: Props) => {
    useEffect(() => {
        if (!children) return;
        document.title = Array.isArray(children)
            ? children.join('')
            : children.toString();
    }, [children]);

    return null;
};