import Stack from "@/twui/components/layout/Stack";
import AdminSummary from "./(sections)/summary";
import AdminHero from "../../general/admin/hero";
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 DeploymentServices from "./services/(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 />
            <AdminSummary />
            <Divider />
            <DeploymentServices />
        </Fragment>
    );
}
