Files
calendar/packages/ui/components/organization-banner/OrgBanner.tsx
T
Keith WilliamsandGitHub 78d06c6d01 refactor: Move classNames from @calcom/lib to @calcom/ui (#19674)
* refactor: Move classNames from @calcom/lib to @calcom/ui

* Import fix

* Removed extra import of classNames

* Removed tailwind-merge from @calcom/lib
2025-03-03 15:54:33 +00:00

34 lines
736 B
TypeScript

import Image from "next/image";
import classNames from "@calcom/ui/classNames";
type Maybe<T> = T | null | undefined;
export type OrgBannerProps = {
alt: string;
width?: number;
height?: number;
imageSrc?: Maybe<string>;
fallback?: React.ReactNode;
className?: string;
"data-testid"?: string;
};
export function OrgBanner(props: OrgBannerProps) {
const { imageSrc, alt, width = 1500, height = 500 } = props;
if (!imageSrc) {
return <div className={classNames("bg-muted", props.className)}>{props.fallback}</div>;
}
return (
<Image
data-testid={props?.["data-testid"]}
src={imageSrc}
alt={alt}
className={props.className}
width={width}
height={height}
/>
);
}