import React, {useState} from 'react';
import {useIntl} from 'gatsby-plugin-intl';
import * as styles from './ReleaseUpdate.module.scss';
import * as DOWNLOAD_COPY from '../../data/copy/downloads';
// @ts-ignore
import expandIcon from '/node_modules/uswds/dist/img/usa-icons/expand_more.svg';
// @ts-ignore
import collapseIcon from '/node_modules/uswds/dist/img/usa-icons/expand_less.svg';
export interface IReleaseUpdateProps {
}
interface IJ40AccordionItem {
id: string,
children: React.ReactElement
}
/**
* This function will create the custom Accordion item. This will be used
* for the race and age demographic UI elements
*
* @param {IJ40AccordionItem} props
* @return {JSX.Element}
*/
const J40AccordionItem = ({id, children}:IJ40AccordionItem) => {
const intl = useIntl();
const [isExpanded, setIsExpanded] = useState(false);
return (
<>
{intl.formatMessage(DOWNLOAD_COPY.PAGE_INTRO.VIEW)}{' '}
setIsExpanded(!isExpanded)}
tabIndex={0}
>
{intl.formatMessage(DOWNLOAD_COPY.PAGE_INTRO.CHANGE_LOG)}
{ isExpanded ?
setIsExpanded(!isExpanded)}
/> :
setIsExpanded(!isExpanded)}
/>
}