import { Link, useNavigate } from "react-router-dom"; import { useQuery } from "@tanstack/react-query"; import { ArrowLeft, FolderGit2 } from "lucide-react"; import { api } from "../../shared/api/client"; import { useMe } from "../auth/useAuth"; import { ProjectRow } from "../../components/ProjectRow"; import { EmptyState } from "../../components/EmptyState"; /** 我的提交(fish No.929):登录用户看自己提交过的项目。 */ export function MyProjectsPage() { const meQ = useMe(); const nav = useNavigate(); const authed = meQ.data?.authenticated === true; const listQ = useQuery({ queryKey: ["my", "projects"], queryFn: api.myProjects, enabled: authed, retry: false, }); if (meQ.isSuccess && !authed) { // 未登录:回首页登录 nav("/", { replace: true }); return null; } const projects = listQ.data?.projects ?? []; return (
Projects you submitted for scanning. Sign in with the same GitHub account to see scan results and manage disclosures.