import { useLocation } from "react-router";

function titleFromPath(pathname: string) {
  const segment = pathname.split("/").filter(Boolean).at(-1) ?? "workspace";
  return segment
    .split("-")
    .map((part) => part.slice(0, 1).toUpperCase() + part.slice(1))
    .join(" ");
}

export default function WorkspacePlaceholderPage() {
  const location = useLocation();
  const title = titleFromPath(location.pathname);

  return (
    <div className="flex h-full items-center justify-center px-8 py-10">
      <div className="text-center">
        <h1 className="text-2xl font-heading font-semibold text-foreground">{title}</h1>
        <p className="mt-3 text-base text-muted-foreground">
          This section is ready for content.
        </p>
      </div>
    </div>
  );
}