Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export const useCellStyling = ({ rowHeight }, classes) => ({ column }) => {
const style: CSSProperties = {};
if (rowHeight) {
style.height = `${rowHeight}px`;
}
switch (column.hAlign) {
case TextAlign.Begin:
style.justifyContent = 'flex-start';
break;
case TextAlign.Center:
style.justifyContent = 'center';
break;
case TextAlign.End:
style.justifyContent = 'flex-end';
break;
case TextAlign.Left:
style.justifyContent = 'left';
break;
case TextAlign.Right:
style.justifyContent = 'right';
break;
}
switch (column.vAlign) {
hooks.getCellProps.push((cellProps, { cell: { column }, instance }) => {
const { classes, rowHeight } = instance.webComponentsReactProperties;
const style: CSSProperties = {};
if (rowHeight) {
style.height = `${rowHeight}px`;
}
switch (column.hAlign) {
case TextAlign.Begin:
style.textAlign = 'start';
break;
case TextAlign.Center:
style.textAlign = 'center';
break;
case TextAlign.End:
style.textAlign = 'end';
break;
case TextAlign.Left:
style.textAlign = 'left';
break;
case TextAlign.Right:
style.textAlign = 'right';
break;
}
switch (column.vAlign) {