-
Notifications
You must be signed in to change notification settings - Fork 0
/
page.tsx
63 lines (62 loc) · 1.66 KB
/
page.tsx
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
"use client";
import {
ApplicationAnswers,
ApplicationDetails,
BackButton,
Button,
} from "@allo-team/kit";
import { useQueryClient } from "@ts-rest/react-query/tanstack";
import Link from "next/link";
import { ApplicationReviews } from "~/components/ApplicationReviews";
import { api } from "~/utils/api";
export default function ApplicationPage({
params,
}: {
params: {
chainId: string;
roundId: string;
applicationId: string;
};
}) {
const { chainId, roundId, applicationId } = params;
const queryClient = useQueryClient();
const review = api.reviews.reviewApplication.useMutation({
onSuccess: () =>
queryClient.invalidateQueries({ queryKey: ["reviews", params] }),
});
return (
<div>
<ApplicationDetails
backAction={
<Link href={`/${chainId}/${roundId}`}>
<BackButton />
</Link>
}
primaryAction={
<Button
isLoading={review.isPending}
onClick={() =>
review.mutate({
body: null, // We can add a manual review here
params,
})
}
>
{review.isPending ? "Reviewing..." : "Review Application"}
</Button>
}
id={applicationId}
chainId={Number(chainId)}
roundId={roundId}
/>
<h3 className="mb-2 mt-8 text-xl font-semibold">Reviews</h3>
<ApplicationReviews {...params} />
<h3 className="mb-2 mt-8 text-xl font-semibold">Application Answers</h3>
<ApplicationAnswers
applicationId={applicationId}
chainId={Number(chainId)}
roundId={roundId}
/>
</div>
);
}