import React from 'react'; import { Grid, Typography, Box, FormControlLabel, Checkbox } from '@mui/material'; import { SectionProps } from './types'; interface FeatureCheckboxesProps { state: SectionProps['state']; layout?: 'stack' | 'inline'; } export const FeatureCheckboxesSection: React.FC = ({ state, layout = 'stack' }) => { const options = [ { label: 'Explainer', checked: state.enableExplainer, onChange: (checked: boolean) => state.setEnableExplainer(checked), }, { label: 'Illustration', checked: state.enableIllustration, onChange: (checked: boolean) => state.setEnableIllustration(checked), }, { label: 'Narration', checked: state.enableNarration, onChange: (checked: boolean) => state.setEnableNarration(checked), }, { label: 'Story Video', checked: state.enableVideoNarration, onChange: (checked: boolean) => state.setEnableVideoNarration(checked), }, ]; const renderCheckboxes = (direction: 'row' | 'column') => ( {options.map((option) => ( option.onChange(e.target.checked)} size="small" /> } label={option.label} sx={{ m: 0, '& .MuiFormControlLabel-label': { fontWeight: 600, }, }} /> ))} ); if (layout === 'inline') { return renderCheckboxes('row'); } return ( Story Features {renderCheckboxes('column')} ); };