import {
BrowserRouter,
Link,
Route,
Routes,
} from "react-router-dom";
import { routePath } from "../../contracts/routes.js";
import { decideRouteAccess } from "./navigation-policy.js";
function HomePage() {
return (
Clean Architecture Frontend
런타임 계약이 검증되었습니다.
샘플 리소스
);
}
function SamplePlaceholder() {
return (
샘플 리소스
계약 fixture를 준비하고 있습니다.
);
}
function NotFoundPage() {
return (
페이지를 찾을 수 없습니다.
홈으로 이동
);
}
/**
* @param {{
* authSession: import("../../application/ports/auth-session-port.js").AuthSessionPort
* }} props
*/
function GuardedSampleRoute({ authSession }) {
const decision = decideRouteAccess(
"SAMPLE_RESOURCE_LIST",
authSession.getState(),
);
if (!decision.allowed) {
return (
세션이 필요합니다.
);
}
return ;
}
/**
* @param {{
* authSession: import("../../application/ports/auth-session-port.js").AuthSessionPort,
* basename?: string
* }} props
*/
export function AppRouter({ authSession, basename = "/" }) {
return (
} />
}
/>
} />
);
}