import React from 'react';
import { ContentSection } from 'react-benzin';
import { Grid, Link } from '@material-ui/core';
import EventCard from '../../components/EventCard/EventCard';
import { useEvents } from '../../hooks/APIClient';


const BsuFantomSection: React.FC = () => {
  const { data: events, mutate } = useEvents();

  return (
    <ContentSection sectionName="bsu-fantom" level={1}>
      <p>
        Schedule your offline <Link href="https://edufpmi.bsu.by">EDUFPMI</Link> conference attendance
      </p>
      <ContentSection sectionName="Upcoming events" level={2}>
        <Grid container spacing={2}>
          {events?.map((event, index) => (
            <Grid item xs={4}>
              <EventCard event={event} mutate={mutate} />
            </Grid>
          ))}
        </Grid>
      </ContentSection>
    </ContentSection>
  );
};

export default BsuFantomSection;
