V2 rundown manager (#237)

* refactor: migrate eventlist > rundown
This commit is contained in:
Carlos Valente
2022-10-30 21:07:18 +01:00
committed by GitHub
parent a3f14182a4
commit c03ed07762
55 changed files with 487 additions and 489 deletions
@@ -0,0 +1,34 @@
import { useContext, useEffect } from 'react';
import Empty from 'common/components/state/Empty';
import { LoggingContext } from 'common/context/LoggingContext';
import RundownMenu from 'features/menu/RundownMenu';
import useRundown from '../../common/hooks-query/useRundown';
import Rundown from './Rundown';
import styles from '../editors/Editor.module.scss';
export default function RundownWrapper() {
const { emitError } = useContext(LoggingContext);
const { data, status, isError } = useRundown();
useEffect(() => {
if (isError) {
emitError('Error fetching data');
}
}, [emitError, isError]);
return (
<>
<RundownMenu />
<div className={styles.content}>
{status === 'success' && data ? (
<Rundown entries={data} />
) : (
<Empty text='Connecting to server' />
)}
</div>
</>
);
}