diff --git a/apps/web/app/(use-page-wrapper)/(main-nav)/ShellMainAppDir.tsx b/apps/web/app/(use-page-wrapper)/(main-nav)/ShellMainAppDir.tsx new file mode 100644 index 0000000000..8aedfe510b --- /dev/null +++ b/apps/web/app/(use-page-wrapper)/(main-nav)/ShellMainAppDir.tsx @@ -0,0 +1,65 @@ +import { ShellMainAppDirBackButton } from "app/(use-page-wrapper)/(main-nav)/ShellMainAppDirBackButton"; +import classNames from "classnames"; + +import type { LayoutProps } from "@calcom/features/shell/Shell"; + +// Copied from `ShellMain` but with a different `ShellMainAppDirBackButton` import +// for client/server component separation +export function ShellMainAppDir(props: LayoutProps) { + return ( + <> + {(props.heading || !!props.backPath) && ( +
+ {!!props.backPath && } + {props.heading && ( +
+ {props.HeadingLeftIcon &&
{props.HeadingLeftIcon}
} +
+ {props.heading && ( +

+ {props.heading} +

+ )} + {props.subtitle && ( +

+ {props.subtitle} +

+ )} +
+ {props.beforeCTAactions} + {props.CTA && ( +
+ {props.CTA} +
+ )} + {props.actions && props.actions} +
+ )} +
+ )} + {props.afterHeading && <>{props.afterHeading}} + +
+ {props.children} +
+ + ); +} diff --git a/apps/web/app/(use-page-wrapper)/(main-nav)/ShellMainAppDirBackButton.tsx b/apps/web/app/(use-page-wrapper)/(main-nav)/ShellMainAppDirBackButton.tsx new file mode 100644 index 0000000000..2be728fbd9 --- /dev/null +++ b/apps/web/app/(use-page-wrapper)/(main-nav)/ShellMainAppDirBackButton.tsx @@ -0,0 +1,22 @@ +"use client"; + +import { useRouter } from "next/navigation"; + +import type { LayoutProps } from "@calcom/features/shell/Shell"; +import { Button } from "@calcom/ui"; + +export const ShellMainAppDirBackButton = ({ backPath }: { backPath: LayoutProps["backPath"] }) => { + const router = useRouter(); + return ( +