Home-Toolbox-Plugin/components/ui/placeholder/index.tsx

29 lines
599 B
TypeScript

import { IconSad } from "~assets/icons";
import type { PropsWithChildren } from "react";
import styles from "./placeholder.module.less";
interface PlaceholderProps extends PropsWithChildren {
className?: string;
show?: boolean;
value: string;
}
function Placeholder({ className, show, value, children }: PlaceholderProps) {
if (show === undefined || show) {
return (
<div className={styles.placeholder}>
<IconSad />
<p>{value}</p>
</div>
);
}
return (
<div className={className}>
{children}
</div>
);
}
export default Placeholder;