diff --git a/src/core/Accordion/component.tsx b/src/core/Accordion/component.tsx index 713d944af..c57c1d0dd 100644 --- a/src/core/Accordion/component.tsx +++ b/src/core/Accordion/component.tsx @@ -1,9 +1,9 @@ -import React, { useState, Node, JSX, FC } from "react"; +import React, { useState, ReactNode, JSX, FC } from "react"; import Icon from "../Icon/component.jsx"; export type AccordionData = { name: string; - content: Node; + content: ReactNode; }; export type AccordionRowProps = { @@ -13,7 +13,7 @@ export type AccordionRowProps = { last: boolean; name: string; index: number; - children: Node; + children: ReactNode; arrowIcon: boolean; activeIndex: number; setActiveIndex: (index: number) => void; @@ -27,7 +27,7 @@ export type AccordionProps = { accordionInPageId: string; }; -function AccordionRow({ +const AccordionRow: FC = ({ name, children, index, @@ -37,7 +37,7 @@ function AccordionRow({ bottomBorder, last, arrowIcon, -}: FC) { +}) => { let iconActive: JSX.Element, iconInactive: JSX.Element; const handleSetIndex = () => { if (active) { @@ -101,15 +101,15 @@ function AccordionRow({ ); -} +}; -function Accordion({ +const Accordion: FC = ({ data, accordionInPageId = "id-accordion", topBorder, bottomBorder, arrowIcon, -}: AccordionProps) { +}) => { const [activeIndex, setActiveIndex] = useState(null); return ( @@ -138,6 +138,6 @@ function Accordion({ })} ); -} +}; export default Accordion;