Files
calendar/apps/web/app/(use-page-wrapper)/(main-nav)/ShellMainAppDirBackButton.tsx
T
ee31633e2b perf: layout persistence and reduced bundle size (#18889)
* create /(main-nav)/layout.tsx file that uses Shell

* Add ShellMainAppDir that clones ShellMain but with client/server separation

* event-types, availability, bookings

* update pagesAndRewritePaths logic

* fix

---------

Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2025-01-27 11:08:47 +00:00

23 lines
632 B
TypeScript

"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 (
<Button
variant="icon"
size="sm"
color="minimal"
onClick={() => (typeof backPath === "string" ? router.push(backPath as string) : router.back())}
StartIcon="arrow-left"
aria-label="Go Back"
className="rounded-md ltr:mr-2 rtl:ml-2"
data-testid="go-back-button"
/>
);
};