Skip to content
This repository was archived by the owner on Sep 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 0 additions & 29 deletions app/components/talks/PendingTalksList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,6 @@ import StatusBadge from './StatusBadge';
import StatusDialog from './StatusDialog';
import TalkDialog from './TalkDialog';

// Mock data for rooms (you should replace this with your actual data)
// const rooms = [
// {
// name: 'Salle Amphithéâtre',
// capacity: 300,
// description: 'Grande salle principale pour les keynotes et sessions populaires',
// },
// {
// name: 'Salle Ateliers',
// capacity: 100,
// description: 'Salle équipée pour les ateliers pratiques et hands-on labs',
// },
// {
// name: 'Salle Conférences A',
// capacity: 150,
// description: 'Salle de conférence standard pour les présentations techniques',
// },
// {
// name: 'Salle Conférences B',
// capacity: 150,
// description: 'Salle de conférence standard pour les présentations techniques',
// },
// {
// name: 'Salle Innovation',
// capacity: 80,
// description: 'Espace dédié aux démonstrations et nouvelles technologies',
// },
// ];

interface PendingTalksListProps {
talks: Talk[];
onAddTalk: (talk: Omit<Talk, 'id'>) => void;
Expand Down
4 changes: 0 additions & 4 deletions app/components/talks/TalksList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ interface TalksListProps {
onAddTalk: (talk: Omit<Talk, 'id'>) => void;
onUpdateTalk: (talk: Talk) => void;
onDeleteTalk: (talkId: string) => void;
// scheduledTalks: ScheduledTalk[];
rooms?: Room[];
// topics: string[];
}

// Helper to generate Google Calendar event link
Expand Down Expand Up @@ -57,9 +55,7 @@ export default function TalksList({
onAddTalk,
onUpdateTalk,
onDeleteTalk,
// scheduledTalks,
rooms = [],
// topics,
}: TalksListProps) {
const session = useSession();

Expand Down
10 changes: 0 additions & 10 deletions app/components/talks/TalksSchedule.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ interface TalksScheduleProps {
onScheduleTalk: (talkId: string, slotId: string) => void;
}

// interface ScheduledSlot {
// id: number;
// roomId: number;
// startTime: string;
// endTime: string;
// talk: Talk;
// }

export default function TalksSchedule({ talks, onScheduleTalk }: TalksScheduleProps) {
const session = useSession();

Expand All @@ -67,7 +59,6 @@ export default function TalksSchedule({ talks, onScheduleTalk }: TalksSchedulePr
const [selectedTalk, setSelectedTalk] = useState<string>('');
const [selectedSlot, setSelectedSlot] = useState<string>('');
const [isScheduling, setIsScheduling] = useState<boolean>(false);
// const [scheduledSlots, setScheduledSlots] = useState<ScheduledSlot[]>([]);

// — new state —
const [rooms, setRooms] = useState<RoomWithSlots[]>([]);
Expand All @@ -79,7 +70,6 @@ export default function TalksSchedule({ talks, onScheduleTalk }: TalksSchedulePr
Promise.all([
fetch(`/api/rooms/availability?date=${dateParam}`).then((r) => r.json()),
fetch(`/api/schedules?date=${dateParam}`).then((r) => r.json()),
// .then((data: { schedules: ScheduledSlot[] }) => setScheduledSlots(data.schedules)),
]).catch((err) => {
console.error(err);
alert('Erreur de chargement');
Expand Down
28 changes: 12 additions & 16 deletions app/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,6 @@ export default function TalksPage() {
const updatedSlot = { ...slot, talkId: talk.id };

setTalks((prev) => prev.map((t) => (t.id === talk.id ? updatedTalk : t)));
// setScheduledTalks((prev) => [
// ...prev,
// {
// talk: updatedTalk,
// slot: updatedSlot,
// room: mockData.rooms.find((r) => r.id === slot.roomId)!,
// },
// ]);

return { updatedTalk, updatedSlot };
};
Expand All @@ -99,12 +91,8 @@ export default function TalksPage() {
} else {
const err = await res.json();
console.error('Failed to delete talk:', err.error);
// optionally show a toast/snackbar here
}
};
// const changeTalkStatus = (talkId: string, newStatus: Talk['status']) => {
// setTalks((prev) => prev.map((t) => (t.id === talkId ? { ...t, status: newStatus } : t)));
// };

async function changeTalkStatus(talkId: string, newStatus: TalkStatus) {
const res = await fetch(`/api/talks/${talkId}/status`, {
Expand Down Expand Up @@ -148,7 +136,18 @@ export default function TalksPage() {
<TabsList className="grid w-full grid-cols-3">
<TabsTrigger value="talks">Tous les talks</TabsTrigger>
<TabsTrigger value="pending">Tous les talks en attente</TabsTrigger>
<TabsTrigger value="schedule">Planification</TabsTrigger>
<TabsTrigger value="schedule">
Planification
<span
className={`ml-2 inline-flex items-center justify-center rounded-full px-2 py-0.5 text-xs font-semibold ${
talks.filter((talk) => talk.status === 'accepted').length === 0
? 'bg-gray-400 text-white'
: 'bg-red-600 text-white'
}`}
>
{talks.filter((talk) => talk.status === 'accepted').length}
</span>
</TabsTrigger>
</TabsList>
)}

Expand Down Expand Up @@ -185,9 +184,6 @@ export default function TalksPage() {
{/* Tab: Planification */}
<TabsContent value="schedule">
<TalksSchedule
// rooms={mockData.rooms}
// scheduledTalks={scheduledTalks}
// slots={mockData.slots}
talks={talks.filter((talk) => talk.status === 'accepted')}
onScheduleTalk={scheduleTalk}
/>
Expand Down
Loading