Files
calendar/packages/ui/components/organization-banner/OrgBanner.tsx
T
7ee3f9409c feat: [CAL-3939] fix org banner (#15557)
* update documentation for proper hostile command

* add OrgBanner component and replace it in ee organization profile settings

* add width and height defaults, with option to override

* updated sizing with image loaded

* fix: add alt to OrgBanner in test

* fix: failing OrgBanner test, added neg test

---------

Co-authored-by: Keith Williams <keithwillcode@gmail.com>
Co-authored-by: Anik Dhabal Babu <81948346+anikdhabal@users.noreply.github.com>
Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
Co-authored-by: Peer Richelsen <peeroke@gmail.com>
2024-07-19 05:30:50 +00:00

34 lines
737 B
TypeScript

import Image from "next/image";
import classNames from "@calcom/lib/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}
/>
);
}