PageHeader.tsx 713 B

123456789101112131415161718192021222324252627282930
  1. import { FC } from 'react';
  2. import { useCurrentPagePath, useSWRxCurrentPage } from '~/stores/page';
  3. import { PagePath } from './PagePath';
  4. import { PageTitle } from './PageTitle';
  5. export const PageHeader: FC = () => {
  6. const { data: currentPagePath } = useCurrentPagePath();
  7. const { data: currentPage } = useSWRxCurrentPage();
  8. if (currentPage == null || currentPagePath == null) {
  9. return <></>;
  10. }
  11. return (
  12. <>
  13. <div className="pull-left">
  14. <PagePath
  15. currentPagePath={currentPagePath}
  16. currentPage={currentPage}
  17. />
  18. <PageTitle
  19. currentPagePath={currentPagePath}
  20. currentPage={currentPage}
  21. />
  22. </div>
  23. </>
  24. );
  25. };