diff --git a/app/routes/et-members_.strikes_.$uid.tsx b/app/routes/et-members_.strikes_.$uid.tsx index b23745b..7a3a833 100644 --- a/app/routes/et-members_.strikes_.$uid.tsx +++ b/app/routes/et-members_.strikes_.$uid.tsx @@ -24,7 +24,7 @@ import { } from "@chakra-ui/react"; import { LoaderFunctionArgs } from "@remix-run/cloudflare"; import { useLoaderData } from "@remix-run/react"; -import { useEffect, useState } from "react"; +import { useState } from "react"; export async function loader({ context, @@ -60,15 +60,11 @@ export async function loader({ export default function () { const { can_manage, strikes, user } = useLoaderData(); - const [strikeData, setStrikeData] = useState([] as typeof strikes); + const [strikeData, setStrikeData] = useState(strikes); const toast = useToast(); const [rmStrikeId, setRmStrikeId] = useState(""); const [strikeReason, setStrikeReason] = useState(""); - useEffect(() => { - setStrikeData(strikes); - }, []); - async function removeStrike(id: string) { const removeResp = await fetch(`/api/events-team/strikes/${id}`, { method: "DELETE", @@ -208,10 +204,12 @@ export default function () { - - - - + + + + + + {strikeData.map((strike: { [k: string]: any }) => (
Time AddedAdded ByReasonRemove
Time AddedAdded ByReasonRemove