mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-19 14:14:17 +00:00
refactor: visibility options
This commit is contained in:
committed by
Carlos Valente
parent
430b72c1d0
commit
c9ef2465f8
+5
-4
@@ -3,6 +3,7 @@ import { flexRender, HeaderGroup } from '@tanstack/react-table';
|
||||
import { OntimeRundownEntry } from 'ontime-types';
|
||||
|
||||
import { getAccessibleColour } from '../../../../common/utils/styleUtils';
|
||||
import { useCuesheetOptions } from '../../cuesheet.options';
|
||||
|
||||
import { SortableCell } from './SortableCell';
|
||||
|
||||
@@ -10,11 +11,11 @@ import style from '../CuesheetTable.module.scss';
|
||||
|
||||
interface CuesheetHeaderProps {
|
||||
headerGroups: HeaderGroup<OntimeRundownEntry>[];
|
||||
showIndexColumn: boolean;
|
||||
}
|
||||
|
||||
export default function CuesheetHeader(props: CuesheetHeaderProps) {
|
||||
const { headerGroups, showIndexColumn } = props;
|
||||
const { headerGroups } = props;
|
||||
const { hideIndexColumn, showActionMenu } = useCuesheetOptions();
|
||||
|
||||
return (
|
||||
<thead className={style.tableHeader}>
|
||||
@@ -23,8 +24,8 @@ export default function CuesheetHeader(props: CuesheetHeaderProps) {
|
||||
|
||||
return (
|
||||
<tr key={headerGroup.id}>
|
||||
<th className={style.actionColumn} />
|
||||
<th className={style.indexColumn}>{showIndexColumn && '#'}</th>
|
||||
{showActionMenu && <th className={style.actionColumn} />}
|
||||
{!hideIndexColumn && <th className={style.indexColumn}>#</th>}
|
||||
<SortableContext key={key} items={headerGroup.headers} strategy={horizontalListSortingStrategy}>
|
||||
{headerGroup.headers.map((header) => {
|
||||
const width = header.getSize();
|
||||
|
||||
Reference in New Issue
Block a user