Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
850 B
4
Indexable
Never
const AccordionCustomStyles: FC<Props> = ({ data }) => {
  if(!data) return null;
  return (
    <Accordion
      variant="splitted"
      defaultExpandedKeys={["0"]}
      itemClasses={itemClasses}
    >
      {data.map((item, index) => (
        <AccordionItem
          key={`${index}`}
          aria-label={`acc${index}`}
          title={item.title} // This is already in h2
          indicator={({ isOpen }) => (<Icon open={isOpen}/> )}
        >
          <div className="content-container">
            {item?.body?.map((bItem, ind) => (
              // Wrap content in `h3` instead of `p`, apply margin accordingly
              <h3 key={`${index}-${ind}`} className={`${ind !== 0 ? 'mt-4' : 'mt-0'}`}>
                {bItem}
              </h3>
            ))}
          </div>
        </AccordionItem>
      ))}
    </Accordion>
  );
};
Leave a Comment