website refactor
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
import { AdminUsersPageQuery } from '@/lib/page-queries/AdminUsersPageQuery';
|
||||
import { AdminUsersWrapper } from './AdminUsersWrapper';
|
||||
import { ErrorBanner } from '@/components/ui/ErrorBanner';
|
||||
|
||||
interface AdminUsersPageProps {
|
||||
searchParams?: {
|
||||
@@ -28,24 +29,24 @@ export default async function AdminUsersPage({ searchParams }: AdminUsersPagePro
|
||||
const error = result.getError();
|
||||
if (error === 'notFound') {
|
||||
return (
|
||||
<div className="container mx-auto p-6">
|
||||
<div className="bg-racing-red/10 border border-racing-red text-racing-red px-4 py-3 rounded-lg">
|
||||
Access denied - You must be logged in as an Owner or Admin
|
||||
</div>
|
||||
</div>
|
||||
<ErrorBanner
|
||||
title="Access Denied"
|
||||
message="You must be logged in as an Owner or Admin"
|
||||
variant="error"
|
||||
/>
|
||||
);
|
||||
}
|
||||
return (
|
||||
<div className="container mx-auto p-6">
|
||||
<div className="bg-racing-red/10 border border-racing-red text-racing-red px-4 py-3 rounded-lg">
|
||||
Failed to load users: {error}
|
||||
</div>
|
||||
</div>
|
||||
<ErrorBanner
|
||||
title="Load Failed"
|
||||
message={`Failed to load users: ${error}`}
|
||||
variant="error"
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
||||
const viewData = result.unwrap();
|
||||
const output = result.unwrap();
|
||||
|
||||
// Pass to client wrapper for UI interactions
|
||||
return <AdminUsersWrapper initialViewData={viewData} />;
|
||||
return <AdminUsersWrapper initialViewData={output} />;
|
||||
}
|
||||
Reference in New Issue
Block a user