Raid Group calendar working

This commit is contained in:
2025-03-07 21:54:17 -05:00
parent 61789d7ca2
commit 0dfb971bc2
8 changed files with 213 additions and 30 deletions

View File

@@ -0,0 +1,38 @@
import DangerMessage from "@/components/message/DangerMessage";
import { useGetGameCalendar, useGetRaidGroupCalendar } from "@/hooks/CalendarHooks";
import CalendarDisplay from "./CalendarDisplay";
export default function RaidGroupCalendarLoader({
gameId,
raidGroupId
}:{
gameId: string;
raidGroupId: string;
}){
const gameCalendarQuery = useGetGameCalendar(gameId);
const raidGroupCalendarQuery = useGetRaidGroupCalendar(raidGroupId);
if(raidGroupCalendarQuery.status === "error"){
return (<DangerMessage>Error {raidGroupCalendarQuery.error.message}</DangerMessage>);
}
else if(gameCalendarQuery.status === "error"){
return (<DangerMessage>Error {gameCalendarQuery.error.message}</DangerMessage>);
}
else if((raidGroupCalendarQuery.status === "pending") || (gameCalendarQuery.status === "pending")){
return (
<div>
Loading...
</div>
);
}
else{
return (
<CalendarDisplay
raidGroupId={raidGroupId}
calendarEvents={[...raidGroupCalendarQuery.data, ...gameCalendarQuery.data]}
/>
);
}
}