SidebarContents.tsx 642 B

12345678910111213141516171819202122232425262728293031
  1. import React, { FC } from 'react';
  2. import { SidebarContentsType } from '~/interfaces/ui';
  3. import { useCurrentSidebarContents } from '~/stores/ui';
  4. import RecentChanges from './RecentChanges';
  5. import CustomSidebar from './CustomSidebar';
  6. type Props = {
  7. };
  8. const SidebarContents: FC<Props> = (props: Props) => {
  9. const { data: currentSidebarContents } = useCurrentSidebarContents();
  10. let Contents;
  11. switch (currentSidebarContents) {
  12. case SidebarContentsType.RECENT:
  13. Contents = RecentChanges;
  14. break;
  15. default:
  16. Contents = CustomSidebar;
  17. }
  18. return (
  19. <Contents />
  20. );
  21. };
  22. export default SidebarContents;