refactor: restructure element composition

This commit is contained in:
Carlos Valente
2024-12-17 13:24:43 +01:00
committed by Carlos Valente
parent 67fa747aae
commit 8f30c0a7df
12 changed files with 728 additions and 0 deletions
@@ -0,0 +1,27 @@
import { memo } from 'react';
import { useCurrentBlockId } from '../../../../common/hooks/useSocket';
import style from '../CuesheetTable.module.scss';
interface BlockRowProps {
hidePast: boolean;
title: string;
}
function BlockRow(props: BlockRowProps) {
const { hidePast, title } = props;
const { currentBlockId } = useCurrentBlockId();
if (hidePast && !currentBlockId) {
return null;
}
return (
<tr className={style.blockRow}>
<td>{title}</td>
</tr>
);
}
export default memo(BlockRow);