@@ -54,25 +61,32 @@ const AccordionItem = ({ titleSize, children, ...props }) => {
);
};
-const AccordionItemHeader = ({ titleSize, children, ...props }) => {
+const AccordionItemHeader = ({
+ title,
+ titleSize,
+ icon,
+ image,
+ children,
+ ...props
+}) => {
const [ isOpen ] = useState( false );
const countChildren = React.Children.toArray( children ).length;
- const icon = props.icon && '' !== props.icon
- ?
+ const titleColumnIcon = 'undefined' !== typeof icon && '' !== icon
+ ?
: '';
- const image = props.image && '' !== props.icon
- ?
+ const titleColumnImage = 'undefined' !== typeof image && '' !== icon
+ ?
: '';
const titleColumnSize = 'undefined' !== typeof titleSize && '' !== titleSize
? ' sui-accordion-col-' + titleSize
: '';
- const title = (
+ const titleColumn = (
- { icon }{ image }{ props.title }
+ { titleColumnIcon }{ titleColumnImage }{ title }
);
@@ -111,7 +125,7 @@ const AccordionItemHeader = ({ titleSize, children, ...props }) => {
className="sui-accordion-item-header"
{ ...props }
>
- { title }
+ { titleColumn }
{ countChildren > 0 ? columns : actions }
);