Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import imagePlaceholder from "@/app/assets/images/tournament.webp";
import PostsApi from "@/services/posts";
import { PostWithNotebook } from "@/types/post";
import { getNotebookSummary } from "@/utils/questions";
import WithServerComponentErrorBoundary from "@/components/server_component_error_boundary";

type Props = {
postIds: number[];
Expand Down Expand Up @@ -91,4 +92,4 @@ const ResearchAndUpdatesBlock: FC<Props> = async ({ postIds }) => {
);
};

export default ResearchAndUpdatesBlock;
export default WithServerComponentErrorBoundary(ResearchAndUpdatesBlock);
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { getTranslations } from "next-intl/server";
import { FC } from "react";

import TournamentCard from "@/components/tournament_card";
import WithServerComponentErrorBoundary from "@/components/server_component_error_boundary";
import ProjectsApi from "@/services/projects";
import { Tournament, TournamentType } from "@/types/projects";

Expand Down Expand Up @@ -60,4 +61,4 @@ const TournamentsBlock: FC<Props> = async ({ postSlugs }) => {
);
};

export default TournamentsBlock;
export default WithServerComponentErrorBoundary(TournamentsBlock);
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import {
SCORING_DURATION_FILTER,
SCORING_YEAR_FILTER,
} from "../../search_params";
import WithServerComponentErrorBoundary from "@/components/server_component_error_boundary";

type Props = {
category: CategoryKey;
Expand Down Expand Up @@ -72,12 +73,13 @@ const ContributionsHero: FC<Props> = ({ year, duration, category, userId }) => {
);
};

const AwaitedUserHeader: FC<{ userId: number }> = async ({ userId }) => {
const t = await getTranslations();
const profile = await ProfileApi.getProfileById(userId);
const AwaitedUserHeader: FC<{ userId: number }> =
WithServerComponentErrorBoundary(async ({ userId }) => {
const t = await getTranslations();
const profile = await ProfileApi.getProfileById(userId);

return <UserHeader>{profile.username ?? t("user")}</UserHeader>;
};
return <UserHeader>{profile.username ?? t("user")}</UserHeader>;
});

const UserHeader: FC<PropsWithChildren> = ({ children }) => (
<h1 className="m-0 text-2xl font-bold text-blue-900 dark:text-blue-900-dark sm:text-4xl">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import { FC } from "react";
import ContributionsTable from "@/app/(main)/(leaderboards)/contributions/components/contributions_table";
import LeaderboardApi from "@/services/leaderboard";
import { CategoryKey, LeaderboardType } from "@/types/scoring";
import WithServerComponentErrorBoundary from "@/components/server_component_error_boundary";

type Props = {
startTime: string;
Expand All @@ -19,21 +20,21 @@ const GlobalContributions: FC<Props> = async ({
startTime,
category,
}) => {
const contributionsDetails = await LeaderboardApi.getContributions({
type: "global",
leaderboardType,
userId,
startTime,
endTime,
});
const contributionsDetails = await LeaderboardApi.getContributions({
type: "global",
leaderboardType,
userId,
startTime,
endTime,
});

return (
<ContributionsTable
category={category}
leaderboardEntry={contributionsDetails.leaderboard_entry}
contributions={contributionsDetails.contributions}
/>
);
return (
<ContributionsTable
category={category}
leaderboardEntry={contributionsDetails.leaderboard_entry}
contributions={contributionsDetails.contributions}
/>
);
};

export default GlobalContributions;
export default WithServerComponentErrorBoundary(GlobalContributions);
Loading