import type { Metadata } from "next";
import Script from "next/script";
import "./globals.css";

export const metadata: Metadata = {
  title: {
    default: "Ali Taghavi | علی تقوی",
    template: "%s | Ali Taghavi",
  },
  description: "CEO @ NODE-Group · Builder · Strategist · Tehran, Iran",
  metadataBase: new URL("https://biztaghavi.com"),
};

const umamiSrc = process.env.NEXT_PUBLIC_UMAMI_URL;
const umamiId = process.env.NEXT_PUBLIC_UMAMI_WEBSITE_ID;

export default function RootLayout({
  children,
}: Readonly<{
  children: React.ReactNode;
}>) {
  return (
    <>
      {umamiSrc && umamiId && (
        <Script
          async
          defer
          src={umamiSrc}
          data-website-id={umamiId}
          strategy="afterInteractive"
        />
      )}
      {children}
    </>
  );
}
