mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-31 11:59:10 +00:00
0e6d6cd416
* refactor: allow secondary rundowns * ui: move dropdown * feat: follow loaded * ui: background edit warning ui: fix disable radio button * feat(ui): add loaded sufix in the rundown list * feat(ui): add direct link to background edit from rundown manager * fix: better fallback * fix: default to is isCurrentRundown for nav bar colour * chore: rename navigate to cuesheet --------- Co-authored-by: alex-arc <ac@omnivox.dk>
55 lines
2.3 KiB
TypeScript
55 lines
2.3 KiB
TypeScript
import { useDisclosure } from '@mantine/hooks';
|
|
import { IoApps } from 'react-icons/io5';
|
|
|
|
import IconButton from '../../common/components/buttons/IconButton';
|
|
import NavigationMenu from '../../common/components/navigation-menu/NavigationMenu';
|
|
import { EntryActionsProvider } from '../../common/context/EntryActionsContext';
|
|
import { useScopedRundown } from '../../common/hooks-query/useScopedRundown';
|
|
import { useScopedEntryActions } from '../../common/hooks/useEntryAction';
|
|
import { useWindowTitle } from '../../common/hooks/useWindowTitle';
|
|
import { getIsNavigationLocked } from '../../externals';
|
|
import CuesheetOverview from '../../features/overview/CuesheetOverview';
|
|
import EntryEditModal from './cuesheet-edit-modal/EntryEditModal';
|
|
import CuesheetProgress from './cuesheet-progress/CuesheetProgress';
|
|
import CuesheetTableWrapper from './CuesheetTableWrapper';
|
|
import { FOLLOW_LOADED_RUNDOWN_ID, useCuesheetRundownSelection } from './useCuesheetRundownSelection';
|
|
|
|
import styles from './CuesheetPage.module.scss';
|
|
|
|
export default function CuesheetPage() {
|
|
'use memo';
|
|
const [isMenuOpen, menuHandler] = useDisclosure();
|
|
const { selectedRundownId, loadedRundownId, setSelectedRundownId, projectRundowns } = useCuesheetRundownSelection();
|
|
const source = useScopedRundown(selectedRundownId === FOLLOW_LOADED_RUNDOWN_ID ? loadedRundownId : selectedRundownId);
|
|
|
|
const actions = useScopedEntryActions(source.rundownId);
|
|
|
|
useWindowTitle('Cuesheet');
|
|
|
|
const isLocked = getIsNavigationLocked();
|
|
|
|
return (
|
|
<EntryActionsProvider actions={actions}>
|
|
<NavigationMenu isOpen={isMenuOpen} onClose={menuHandler.close} />
|
|
<EntryEditModal rundown={source.rundown} />
|
|
<div className={styles.tableWrapper} data-testid='cuesheet'>
|
|
<CuesheetOverview>
|
|
{!isLocked && (
|
|
<IconButton aria-label='Toggle navigation' variant='subtle-white' size='xlarge' onClick={menuHandler.open}>
|
|
<IoApps />
|
|
</IconButton>
|
|
)}
|
|
</CuesheetOverview>
|
|
<CuesheetProgress />
|
|
<CuesheetTableWrapper
|
|
source={source}
|
|
selectedRundownId={selectedRundownId}
|
|
loadedRundownId={loadedRundownId}
|
|
setSelectedRundownId={setSelectedRundownId}
|
|
projectRundowns={projectRundowns}
|
|
/>
|
|
</div>
|
|
</EntryActionsProvider>
|
|
);
|
|
}
|