All Downloads are FREE. Search and download functionalities are using the official Maven repository.

pages.List.tsx Maven / Gradle / Ivy

import ListBreadcrumbs from 'components/breadcrumbs/ListBreadcrumbs';
import StickyBannerLayout from 'components/layout/common/StickyBannerLayout';
import ListPage from 'components/view/ListPage';
import ViewLayout from 'components/view/ViewLayout';
import RenderContextProvider from 'contexts/RenderContext';
import { useConfig } from 'hooks/config';
import { useNotifier } from 'hooks/notification';
import NotFound from 'pages/NotFound';
import { GET_LIST_SCHEMA } from 'queries/list';
import { Helmet } from 'react-helmet';
import { useTranslation } from 'react-i18next';
import { useParams } from 'react-router';
import { Link } from 'types/graphql';
import { handleResult } from 'utils/utils';

import { useQuery } from '@apollo/client';

const List = (): JSX.Element  => {
  const {t}             = useTranslation()
  const { project }     = useConfig()
  const { id: listKey } = useParams();

  return (
    <>
      
        {t('list')} | {project}
      
      
        
      
    
  );
}

const ListResult = (): JSX.Element => {
  const { id: listKey } = useParams();
  const listResult      = useQuery(GET_LIST_SCHEMA, { variables: { key: listKey } })
  const notifier        = useNotifier()
  
  return handleResult(listResult, notifier, 
    (data: any) => {
      const schema             = data.list.schema
      const translationBaseKey = `views.lists.${schema.key}`
      const augSchema          = { ...schema, kind: "list", translationBaseKey }

      return 
    },
    (error: any) => {
      console.error("GraphQL error: %o", error);
      return 
    }
  )
}

const ListResultPage = ({ schema, links }: {schema: any, links: Link[]}) => {
  const section = { ...schema, links }
  return (
    
      
        }
          bodySx={{ padding: "20px", overflow: "auto" }}
        >
          
        
      
    
  )
}

export default List;




© 2015 - 2024 Weber Informatics LLC | Privacy Policy