Files
calendar/packages/ui/components/unpublished-entity/UnpublishedEntity.tsx
T
Alex van AndelandGitHub be404436d7 fix: Do not self import @calcom/ui (#20050)
* fix: Do not self import @calcom/ui

* Make translations optional

* Fix mocking implementation of Button (never worked)

* Ensure other libraries can resolve AppListCard
2025-03-13 18:17:42 +00:00

41 lines
1.2 KiB
TypeScript

import { getPlaceholderAvatar } from "@calcom/lib/defaultAvatarImage";
import { useLocale } from "@calcom/lib/hooks/useLocale";
import { Avatar } from "../avatar/Avatar";
import { EmptyScreen } from "../empty-screen/EmptyScreen";
export type UnpublishedEntityProps = {
/**
* If it is passed, don't pass orgSlug
* It conveys two things - Slug for the team and that it is not an organization
*/
teamSlug?: string | null;
/**
* If it is passed, don't pass teamSlug.
* It conveys two things - Slug for the team and that it is an organization infact
*/
orgSlug?: string | null;
/* logo url for entity */
logoUrl?: string | null;
/**
* Team or Organization name
*/
name?: string | null;
};
export function UnpublishedEntity(props: UnpublishedEntityProps) {
const { t } = useLocale();
const slug = props.orgSlug || props.teamSlug;
return (
<div className="m-8 flex items-center justify-center">
<EmptyScreen
avatar={<Avatar alt={slug ?? ""} imageSrc={getPlaceholderAvatar(props.logoUrl, slug)} size="lg" />}
headline={t("team_is_unpublished", {
team: props.name,
})}
description={t(`${props.orgSlug ? "org" : "team"}_is_unpublished_description`)}
/>
</div>
);
}