Files
calendar/packages/ui/components/empty-screen/EmptyScreen.tsx
T
Pasquale VitielloGitHubpasquale@cal.com <pasquale@cal.com>Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>pasquale@cal.com <pasquale@cal.com>Rajiv Sahal
c380ea810c feat: rename --font-cal to --font-heading + use Cal Sans UI (#26064)
* feat: rename --font-cal to --font-heading + use Cal Sans UI

* chore: remove font-weight from font-heading elements and CSS variables

Co-Authored-By: pasquale@cal.com <pasquale@cal.com>

* chore: remove unneeded css vars

* fix: cubic issues

---------

Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Co-authored-by: pasquale@cal.com <pasquale@cal.com>
Co-authored-by: Rajiv Sahal <sahalrajiv-extc@atharvacoe.ac.in>
2026-01-09 10:42:23 +00:00

88 lines
2.6 KiB
TypeScript

import type { ReactNode } from "react";
import React from "react";
import classNames from "@calcom/ui/classNames";
import { Button } from "../button";
import type { IconName } from "../icon";
import { Icon } from "../icon";
export function EmptyScreen({
Icon: icon,
customIcon,
avatar,
headline,
description,
buttonText,
buttonOnClick,
buttonRaw,
border = true,
dashedBorder = true,
className,
iconClassName,
iconWrapperClassName,
limitWidth = true,
}: {
Icon?: IconName;
customIcon?: React.ReactElement;
avatar?: React.ReactElement;
headline: string | React.ReactElement;
description?: string | React.ReactElement;
buttonText?: string;
buttonOnClick?: (event: React.MouseEvent<HTMLElement, MouseEvent>) => void;
buttonRaw?: ReactNode; // Used incase you want to provide your own button.
border?: boolean;
dashedBorder?: boolean;
iconWrapperClassName?: string;
iconClassName?: string;
limitWidth?: boolean;
} & React.HTMLAttributes<HTMLDivElement>) {
return (
<>
<div
data-testid="empty-screen"
className={classNames(
"flex w-full select-none flex-col items-center justify-center rounded-lg p-7 lg:p-20",
border && "border-subtle border",
dashedBorder && "border-dashed",
className
)}>
{!avatar ? null : (
<div className="flex h-[72px] w-[72px] items-center justify-center rounded-full">{avatar}</div>
)}
{!icon ? null : (
<div
className={classNames(
"bg-emphasis flex h-[72px] w-[72px] items-center justify-center rounded-full ",
iconWrapperClassName
)}>
<Icon
name={icon}
className={classNames("text-default inline-block h-10 w-10 stroke-[1.3px]", iconClassName)}
/>
</div>
)}
{!customIcon ? null : <>{customIcon}</>}
<div className={`flex ${limitWidth ? "max-w-[420px]" : ""} flex-col items-center`}>
<h2
className={classNames(
"font-heading text-emphasis text-center text-xl normal-nums",
icon && "mt-6",
!description && "mb-8"
)}>
{headline}
</h2>
{description && (
<div className="text-default mb-8 mt-3 text-center text-sm font-normal leading-6">
{description}
</div>
)}
{buttonOnClick && buttonText && <Button onClick={(e) => buttonOnClick(e)}>{buttonText}</Button>}
{buttonRaw}
</div>
</div>
</>
);
}