import React, { FC } from 'react';
import { AccordionHeaderProps } from 'types';
import Button from 'components/Button';

/**
 * `AccordionHeader` is the internal toggle for activating an `Accordion` component.
 **/

export const AccordionHeader: FC<AccordionHeaderProps> = ({
	title,
	toggle,
	...rest
}) => (
	<Button onClick={toggle} width="100%" {...rest}>
		{title}
	</Button>
);

export default AccordionHeader;
