All files / src/pages/admin project-detail.tsx

100% Statements 7/7
100% Branches 2/2
100% Functions 2/2
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29          27x 27x   27x 2x     27x 1x             26x                
import { useParams, useNavigate } from "@tanstack/react-router";
 
import { ProjectDetailContainer } from "../../components/projects";
 
export function AdminProjectDetailPage() {
	const { projectId } = useParams({ strict: false });
	const navigate = useNavigate();
 
	const handleDelete = () => {
		navigate({ to: "/admin/projects" });
	};
 
	if (!projectId) {
		return (
			<div className="text-center py-12">
				<p className="text-foreground-muted">Project not found</p>
			</div>
		);
	}
 
	return (
		<ProjectDetailContainer
			projectId={projectId}
			context="admin"
			onDelete={handleDelete}
		/>
	);
}