header.tsx 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import type { FC } from 'react'
  2. import React from 'react'
  3. import AppIcon from '@/app/components/base/app-icon'
  4. export type IHeaderProps = {
  5. title: string
  6. customerIcon?: React.ReactNode
  7. icon: string
  8. icon_background: string
  9. isMobile?: boolean
  10. isEmbedScene?: boolean
  11. }
  12. const Header: FC<IHeaderProps> = ({
  13. title,
  14. isMobile,
  15. customerIcon,
  16. icon,
  17. icon_background,
  18. isEmbedScene = false,
  19. }) => {
  20. return !isMobile
  21. ? null
  22. : (
  23. <div
  24. className={`shrink-0 flex items-center justify-between h-12 px-3 bg-gray-100 ${
  25. isEmbedScene ? 'bg-gradient-to-r from-blue-600 to-sky-500' : ''
  26. }`}
  27. >
  28. <div></div>
  29. <div className="flex items-center space-x-2">
  30. {customerIcon || <AppIcon size="small" icon={icon} background={icon_background} />}
  31. <div
  32. className={`text-sm text-gray-800 font-bold ${
  33. isEmbedScene ? 'text-white' : ''
  34. }`}
  35. >
  36. {title}
  37. </div>
  38. </div>
  39. <div></div>
  40. </div>
  41. )
  42. }
  43. export default React.memo(Header)