import React, { useContext } from 'react' import type { ContentTreeWorkarounds } from '@financial-times/cp-content-pipeline-schema' import { ColumnSettingsContext } from '.' import classNames from 'classnames' import { ContentProps } from '../../types' interface TableCellProps extends ContentProps {} export const TableCell: React.FC> = ( props ) => { const allColumnSettings = useContext(ColumnSettingsContext) const columnSettings: ContentTreeWorkarounds.TableColumnSettings = (typeof props.parentIndex === 'number' ? allColumnSettings[props.parentIndex] : undefined) ?? { hideOnMobile: false, sortable: false, } return props.content.heading ? ( {props.children} ) : ( {props.children} ) }