mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 19:58:11 +00:00
25 lines
864 B
TypeScript
25 lines
864 B
TypeScript
// pages/admin/rateMatrix/RateMatrixRegistration.tsx
|
|
import React from 'react';
|
|
import { RateMatrixForm } from '@/components/baselineRatematrix/RateMatrixForm';
|
|
import { useRateMatrixAuth } from '@/auth/useAuth';
|
|
import { Navigate } from 'react-router-dom';
|
|
// Local lightweight fallback for LoadingScreen to avoid import errors
|
|
const LoadingScreen: React.FC<{ message?: string }> = ({ message = 'Loading...' }) => (
|
|
<div style={{ display: 'flex', alignItems: 'center', justifyContent: 'center', height: '100%' }}>
|
|
<div>{message}</div>
|
|
</div>
|
|
);
|
|
|
|
export default function RateMatrixRegistrationPage() {
|
|
const { isDirector, isLoading } = useRateMatrixAuth();
|
|
|
|
if (isLoading) {
|
|
return <LoadingScreen message="Checking permissions..." />;
|
|
}
|
|
|
|
if (!isDirector) {
|
|
return <Navigate to="/unauthorized" replace />;
|
|
}
|
|
|
|
return <RateMatrixForm />;
|
|
} |