Skip to content

Commit

Permalink
Update src/components/Calendar.js.
Browse files Browse the repository at this point in the history
  • Loading branch information
gitauto-ai[bot] authored Sep 18, 2024
1 parent af0d75c commit 8cd3b8d
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions src/components/Calendar.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import React, { useState, useEffect } from 'react';
import { Agenda } from 'modern-react-agenda';

const Calendar = () => {
const [events, setEvents] = useState([]);

useEffect(() => {
// Fetch events from the API
fetch('/api/events')
.then(response => response.json())
.then(data => setEvents(data));
}, []);

return (
<div>
<h1>Sports Events Calendar</h1>
<Agenda events={events} />
</div>
);
};

export default Calendar;

0 comments on commit 8cd3b8d

Please sign in to comment.