header.tsx 1019 B

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