chore: remove mock data usage and initialize state in various components for cleaner setup

This commit is contained in:
Thibault Pouch
2026-03-02 09:47:40 +01:00
parent 65282832cb
commit 3e0eeafac3
7 changed files with 18 additions and 107 deletions

View File

@@ -1,5 +1,4 @@
import { useState, useCallback } from 'react';
import { MOCK_EVENTS, MOCK_POLLS } from '../../data/mockData';
import { useAuth } from '../../contexts/AuthContext';
import { formatDateTime } from '../../utils/format';
import type { EventPost, EventType, Poll, UserRole } from '../../types';
@@ -247,8 +246,8 @@ function EventCard({
export default function IntranetEvents() {
const { user } = useAuth();
const [events, setEvents] = useState<EventPost[]>(MOCK_EVENTS);
const [polls, setPolls] = useState<Poll[]>(MOCK_POLLS);
const [events, setEvents] = useState<EventPost[]>([]);
const [polls, setPolls] = useState<Poll[]>([]);
const [showCreateForm, setShowCreateForm] = useState(false);
// Form state