import { memo, useRef } from 'react'; import { useCurrentBlockId } from '../../../../common/hooks/useSocket'; import style from '../CuesheetTable.module.scss'; interface BlockRowProps { hidePast: boolean; title: string; columnCount: number; } function BlockRow(props: BlockRowProps) { const { hidePast, title, columnCount } = props; const { currentBlockId } = useCurrentBlockId(); const firstCellRef = useRef(null); if (hidePast && !currentBlockId) { return null; } const paddingRows = new Array(columnCount - 1).fill(null); return ( {title} {paddingRows.map((_value, index) => { return ( { firstCellRef.current?.focus(); }} /> ); })} ); } export default memo(BlockRow);