Shape.tsx 605 B

123456789101112131415161718192021222324252627282930313233343536
  1. import clsx from 'clsx';
  2. import Icon from '@/components/Icon';
  3. export default function Shape({
  4. icon,
  5. placeholder,
  6. color,
  7. size,
  8. rounded,
  9. className,
  10. }: {
  11. icon?: string
  12. placeholder?: string | number
  13. color?: string
  14. size?: string
  15. rounded?: boolean
  16. className?: string
  17. }) {
  18. return (
  19. <div
  20. className={clsx(
  21. 'shape',
  22. {
  23. [`shape-${color}`]: color,
  24. [`shape-${size}`]: size,
  25. 'shape-rounded': rounded,
  26. },
  27. className
  28. )}
  29. >
  30. {icon && <Icon name={icon} />}
  31. {placeholder && placeholder}
  32. </div>
  33. );
  34. }