build ok,

This commit is contained in:
louiscklaw
2025-04-14 09:26:24 +08:00
commit 6c931c1fe8
770 changed files with 63959 additions and 0 deletions

View File

@@ -0,0 +1,25 @@
import * as React from 'react';
import Alert from '@mui/material/Alert';
import Box from '@mui/material/Box';
import { config } from '@/config';
import type { AuthStrategy } from '@/lib/auth/strategy';
interface StrategyGuardProps {
children: React.ReactNode;
expected: keyof typeof AuthStrategy;
}
export function StrategyGuard({ children, expected }: StrategyGuardProps): React.JSX.Element {
if (config.auth.strategy !== expected) {
return (
<Box sx={{ p: 3 }}>
<Alert color="error">
To render this page, you need to configure the auth strategy to &quot;{expected}&quot;
</Alert>
</Box>
);
}
return <React.Fragment>{children}</React.Fragment>;
}