"use client";

import { usePageTitle } from "@/hooks/usePageTitle";

type PageTitleProps = {
  children: React.ReactNode;
};

const PageTitle: React.FC<PageTitleProps> = ({ children }) => {
  const titleText = typeof children === "string" ? children : null;
  usePageTitle(titleText);

  return (
    <h1 className="my-7 text-center text-2xl font-bold text-foreground">
      {children}
    </h1>
  );
};

export default PageTitle;
