index.tsx 736 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. import type { FC } from 'react'
  2. import classNames from 'classnames'
  3. import style from './style.module.css'
  4. export type AppIconProps = {
  5. size?: 'tiny' | 'small' | 'medium' | 'large'
  6. rounded?: boolean
  7. icon?: string
  8. background?: string
  9. className?: string
  10. innerIcon?: React.ReactNode
  11. }
  12. const AppIcon: FC<AppIconProps> = ({
  13. size = 'medium',
  14. rounded = false,
  15. background,
  16. className,
  17. innerIcon,
  18. }) => {
  19. return (
  20. <span
  21. className={classNames(
  22. style.appIcon,
  23. size !== 'medium' && style[size],
  24. rounded && style.rounded,
  25. className ?? '',
  26. )}
  27. style={{
  28. background,
  29. }}
  30. >
  31. {innerIcon ? innerIcon : <>🤖</>}
  32. </span>
  33. )
  34. }
  35. export default AppIcon