import React, { useState } from 'react'; import { StudentRequest } from '../types'; interface FacultyRequestsViewProps { onShowToast: (msg: string) => void; } const FacultyRequestsView: React.FC = ({ onShowToast }) => { const [requests, setRequests] = useState([ { id: 'R1', studentName: 'Aditya Varma', rollNo: '21IT001', branch: 'Information Technology', eventName: 'Next-Gen AI Forum', eventId: '1', timestamp: '2h ago', status: 'PENDING' }, { id: 'R2', studentName: 'Priya Dharshini', rollNo: '21CS042', branch: 'Computer Science', eventName: 'Robo-Wars 2025', eventId: '6', timestamp: '4h ago', status: 'PENDING' }, { id: 'R3', studentName: 'Manoj Kumar', rollNo: '22ME015', branch: 'Mechanical Engineering', eventName: 'Robo-Wars 2025', eventId: '6', timestamp: '5h ago', status: 'PENDING' }, { id: 'R4', studentName: 'Sneha Reddy', rollNo: '21IT112', branch: 'Information Technology', eventName: 'Web Architecture 2025', eventId: '2', timestamp: '1d ago', status: 'PENDING' }, ]); const handleAction = (id: string, action: 'APPROVED' | 'REJECTED') => { const req = requests.find(r => r.id === id); if (!req) return; setRequests(prev => prev.filter(r => r.id !== id)); onShowToast(`Request from ${req.studentName} has been ${action.toLowerCase()}.`); }; return (

Registration Requests

Review & Approve Student Access

Total Pending: {requests.length}
{requests.length > 0 ? (
{requests.map((req) => (

{req.studentName}

{req.rollNo} • {req.branch}
{req.timestamp}
Requested Event

{req.eventName}

))}
) : (

No pending requests found

)}
); }; export default FacultyRequestsView;