UNPKG

synapse-react-client

Version:

[![npm version](https://badge.fury.io/js/synapse-react-client.svg)](https://badge.fury.io/js/synapse-react-client) [![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettie

48 lines (47 loc) 1.78 kB
import { jsxs as i, Fragment as g, jsx as o } from "react/jsx-runtime"; import { useGetEvaluation as h, useGetEvaluationRoundsInfinite as x } from "../../synapse-queries/evaluation/useEvaluation.js"; import { getCurrentOrNextOrLatestRound as E } from "../../utils/challenge/evaluation/EvaluationUtils.js"; import { formatDate as d } from "../../utils/functions/DateFormatter.js"; import { InfoTwoTone as v } from "@mui/icons-material"; import N from "@mui/material/Tooltip"; import c from "dayjs"; import { useEffect as S, useMemo as j } from "react"; function $(l) { const { evaluationId: r } = l, { data: e } = h(r), { data: s, hasNextPage: a, isFetchingNextPage: m, fetchNextPage: u } = x(r); S(() => { a && !m && u(); }, [u, a, m]); const p = j( () => s?.pages.flatMap((n) => n.page) ?? [], [s?.pages] ), t = E(p), f = /* @__PURE__ */ i(g, { children: [ e?.description && /* @__PURE__ */ o("p", { children: e?.description }), t?.roundStart && /* @__PURE__ */ i("p", { children: [ /* @__PURE__ */ o("strong", { children: "Start:" }), " ", d(c(t?.roundStart)) ] }), t?.roundEnd && /* @__PURE__ */ i("p", { children: [ /* @__PURE__ */ o("strong", { children: "End:" }), " ", d(c(t?.roundEnd)) ] }), /* @__PURE__ */ i("p", { children: [ /* @__PURE__ */ o("strong", { children: "Submission Limits:" }), " ", t?.limits ? `${t?.limits.map( (n) => `${n.maximumSubmissions} ${n.limitType.toLowerCase()} submissions` ).join(", ")}` : "No limit" ] }) ] }); return /* @__PURE__ */ o(N, { title: f, children: /* @__PURE__ */ o(v, { sx: { color: "grey.700" } }) }); } export { $ as default }; //# sourceMappingURL=EvaluationQueueCurrentRoundInfo.js.map