Fix modules

This commit is contained in:
Logan Cusano
2025-07-13 19:53:36 -04:00
parent 7d3f08cae9
commit e7498a9f8b
5 changed files with 101 additions and 69 deletions

View File

@@ -1,3 +1,11 @@
'use client';
import { useState } from 'react';
import { useAuth } from '@/lib/auth';
import { apiRequest } from '@/lib/api';
import { Button } from '@/components/ui/button';
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
const AdminPage = () => {
const [message, setMessage] = useState('');
const [error, setError] = useState('');
@@ -9,12 +17,11 @@ const AdminPage = () => {
try {
const data = await apiRequest('/videos/scan', { method: 'POST', token: auth.token });
setMessage(data.message);
} catch (err) {
} catch (err: any) {
setError(err.message);
}
};
// In a real app, you'd fetch users and votes here
const users = [{email: 'admin@example.com', role: 'admin'}, {email: 'user@example.com', role: 'user'}];
const votes = [{video_id: 'xyz', decision: 'approve', reason: 'Good clip'}];
@@ -38,7 +45,6 @@ const AdminPage = () => {
<Card>
<CardHeader><CardTitle>Users</CardTitle></CardHeader>
<CardContent>
{/* User list would be rendered here */}
<p>User list functionality would go here.</p>
</CardContent>
</Card>
@@ -46,10 +52,11 @@ const AdminPage = () => {
<Card>
<CardHeader><CardTitle>Votes</CardTitle></CardHeader>
<CardContent>
{/* Vote list would be rendered here */}
<p>Vote list functionality would go here.</p>
</CardContent>
</Card>
</div>
);
};
};
export default AdminPage;