Files
calendso/packages/ui/skeleton/index.tsx
depfu[bot] db01f7be19 Update all Yarn dependencies (2022-05-16) (#2769)
* Update all Yarn dependencies (2022-05-16)

* Upgrade dependencies

* Removes deprecated packages

* Upgrades deps

* Updates submodules

* Update yarn.lock

* Linting

* Linting

* Update website

* Build fixes

* TODO: fix this

* Module resolving

* Type fixes

* Intercom fixes on SSG

* Fixes infinite loop

* Upgrades to React 18

* Type fixes

* Locks node version to 14

* Upgrades daily-js

* Readds missing types

* Upgrades playwright

* Noop when intercom is not installed

* Update website

* Removed yarn.lock in favor of monorepo

Co-authored-by: depfu[bot] <23717796+depfu[bot]@users.noreply.github.com>
Co-authored-by: zomars <zomars@me.com>
2022-05-17 19:31:49 +00:00

36 lines
1.0 KiB
TypeScript

import classNames from "@calcom/lib/classNames";
type SkeletonBaseProps = {
width: string;
height: string;
className?: string;
};
interface AvatarProps extends SkeletonBaseProps {
// Limit this cause we don't use avatars bigger than thi
width: "2" | "3" | "4" | "5" | "6" | "8";
height: "2" | "3" | "4" | "5" | "6" | "8";
}
interface SkeletonContainer {
as?: keyof JSX.IntrinsicElements;
children?: React.ReactNode;
}
const SkeletonAvatar: React.FC<AvatarProps> = ({ width, height }) => {
return (
<div className={`mt-1 rounded-full bg-gray-200 ltr:mr-2 rtl:ml-2 w-${width} h-${height} ${classNames}`} />
);
};
const SkeletonText: React.FC<SkeletonBaseProps> = ({ width, height }) => {
return <div className={`rounded-md bg-gray-200 w-${width} h-${height} ${classNames}`} />;
};
const SkeletonContainer: React.FC<SkeletonContainer> = ({ children, as }) => {
const Component = as || "div";
return <Component className="animate-pulse">{children}</Component>;
};
export { SkeletonAvatar, SkeletonText, SkeletonContainer };