diff --git a/website/blog/2024-12-01-advent-of-pbt-day-1/AdventOfTheDayBuilder.tsx b/website/blog/2024-12-01-advent-of-pbt-day-1/AdventOfTheDayBuilder.tsx index ec9861734a9..3ba5e56fc2e 100644 --- a/website/blog/2024-12-01-advent-of-pbt-day-1/AdventOfTheDayBuilder.tsx +++ b/website/blog/2024-12-01-advent-of-pbt-day-1/AdventOfTheDayBuilder.tsx @@ -147,44 +147,12 @@ export function buildAdventOfTheDay(options: Options) { placeholder={`Example of answer:\n${placeholderForm}`} >
-
- - -
+ ); } - function SolvedTimes() { - const [times, setTimes] = useState(null); - useEffect(() => { - async function update() { - try { - const response = await fetch(`https://api.counterapi.dev/v1/fast-check/AdventOfPBT2024Day${day}Success`); - const data = await response.json(); - const count = data.count || 0; - setTimes(count); - } catch (err) { - setTimes(-1); - } - } - update(); - }, []); - - return ( - - {times === null - ? 'Loading the solve count...' - : times === 0 - ? 'Be the first to solve this challenge!' - : times === -1 - ? 'Unable to retrieve the solve count at the moment.' - : `This puzzle has been solved ${times} time${times > 1 ? 's' : ''}!`} - - ); - } - return { AdventPlaygroundOfTheDay, FormOfTheDay }; }