import SlideInBanner from "@/components/shared/SlideInBanner"; import { useEffect } from "react"; import Footer from "./Footer"; import Header from "./Header"; import MetaInformation from "./MetaInformation"; import { Prose } from "./Prose"; const useExternalLinks = (selector: string) => { useEffect(() => { const links = document.querySelectorAll(selector); links.forEach((link) => { link.setAttribute("target", "_blank"); link.setAttribute("rel", "noopener noreferrer"); }); return () => { links.forEach((link) => { link.removeAttribute("target"); link.removeAttribute("rel"); }); }; }, [selector]); }; interface Props { meta: { title: string; description: string; publishedTime: string; authors: string[]; section: string; tags: string[]; }; children: JSX.Element; } export default function LayoutMdx({ meta, children }: Props) { useExternalLinks(".prose a"); return (
{meta.title && (
{meta.title && (

{meta.title}

)}
)} {children}
); }