"use client";
import { useEffect } from "react";
import { useNavigation } from "../hooks/goto";
import { useParams } from "next/navigation";

type Params = {
    slug: string;
};

export default function SlugRedirector() {
    const { slug } = useParams<Params>();
    const { goTo } = useNavigation();

    useEffect(() => {
        if (slug == "sitemap.xml") {
            goTo("/sitemap.xml");
            return;
        }
        goTo("/landing/org/" + slug);
    }, []);

    return <></>;
}
