import React from 'react'; import { Animation } from '../../components/Animation'; import { Section } from '../../components/Section'; import { GatsbyImage } from 'gatsby-plugin-image'; import { Button, ButtonType } from '../../components/Button'; import { PageSection } from '../../types'; import { useLocalDataSource } from './data'; import * as classes from './style.module.css'; export function InterestsSection(props: PageSection): React.ReactElement { const response = useLocalDataSource(); const data = response.allInterestsJson.sections[0]; const [shownInterests, setShownInterests] = React.useState(5); function loadMoreHandler() { setShownInterests(data.interests.length); } return (
{data.interests.slice(0, shownInterests).map((interest, key) => { return ( {interest.image.src && ( )}{' '} {interest.label} ); })} {shownInterests < data.interests.length && (
); }