import Stack from "@/twui/components/layout/Stack";
import { Fragment, useContext } from "react";
import { AppContext } from "@/src/pages/_app";
import twuiSlugToNormalText from "@/twui/components/utils/slug-to-normal-text";
import Divider from "@/twui/components/layout/Divider";
import AdminHero from "@/src/components/general/admin/hero";
import DeploymentServices from "./(sections)/services";

export default function Main() {
    const { pageProps } = useContext(AppContext);
    const { user, deployment, deployment_id } = pageProps;

    const deployment_name = deployment?.deployment_name;

    return (
        <Fragment>
            <AdminHero
                title={`${twuiSlugToNormalText(deployment_name)} Deplyoment Dashboard`}
                description={
                    <>
                        Deployment{" "}
                        <code>{deployment_id?.split("-").shift()}</code>
                        {` > `}
                        <code>{deployment?.deployment_name}</code>
                    </>
                }
            />
            <Divider />
            <DeploymentServices />
        </Fragment>
    );
}
