import React, { FunctionComponent } from 'react'; import { ctw } from '@/common/utils/ctw/ctw'; import { IContainerProps } from './interfaces'; import { cells } from '@/lib/blocks/create-blocks-typed/create-blocks-typed'; import { keyFactory } from '@/common/utils/key-factory/key-factory'; export const Container: FunctionComponent = ({ value, id, props }) => { if (!Array.isArray(value) || !value?.length) { return null; } return (
{value?.map((cell, index) => { const Cell = cells[cell?.type]; const key = keyFactory( 'container', cell[cell?.keyProp as keyof typeof cell], cell?.id, index, ); return ; })}
); };