You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

index.tsx 1.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import {
  2. useWorkflowMode,
  3. } from '../hooks'
  4. import type { HeaderInNormalProps } from './header-in-normal'
  5. import HeaderInNormal from './header-in-normal'
  6. import HeaderInHistory from './header-in-view-history'
  7. import type { HeaderInRestoringProps } from './header-in-restoring'
  8. import HeaderInRestoring from './header-in-restoring'
  9. export type HeaderProps = {
  10. normal?: HeaderInNormalProps
  11. restoring?: HeaderInRestoringProps
  12. }
  13. const Header = ({
  14. normal: normalProps,
  15. restoring: restoringProps,
  16. }: HeaderProps) => {
  17. const {
  18. normal,
  19. restoring,
  20. viewHistory,
  21. } = useWorkflowMode()
  22. return (
  23. <div
  24. className='absolute left-0 top-0 z-10 flex h-14 w-full items-center justify-between bg-mask-top2bottom-gray-50-to-transparent px-3'
  25. >
  26. {
  27. normal && (
  28. <HeaderInNormal
  29. {...normalProps}
  30. />
  31. )
  32. }
  33. {
  34. viewHistory && (
  35. <HeaderInHistory />
  36. )
  37. }
  38. {
  39. restoring && (
  40. <HeaderInRestoring
  41. {...restoringProps}
  42. />
  43. )
  44. }
  45. </div>
  46. )
  47. }
  48. export default Header