"use client"; import React from "react"; import Link from "next/link"; import { useAuth } from "@/components/auth/authContext"; import { branchPath, homePath } from "@/lib/frontend/routes"; import { Button } from "@/components/ui/button"; import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter, } from "@/components/ui/card"; /** * NotFoundView (RHL-021) * * Used by (protected)/not-found.jsx. * Keeps UX consistent for invalid route params and unknown pages in the protected area. */ export default function NotFoundView() { const { status, user } = useAuth(); const isAuthed = status === "authenticated" && user; const ownBranchHref = isAuthed && user.role === "branch" && user.branchId ? branchPath(user.branchId) : null; return ( Not found The page or resource you requested does not exist.

This can happen when route parameters are invalid (e.g. year/month/day) or the URL is mistyped.

{ownBranchHref ? ( ) : null}
); }