Skip to content

Instantly share code, notes, and snippets.

View dBianchii's full-sized avatar
🇧🇷

Gabriel Bianchi dBianchii

🇧🇷
View GitHub Profile
@dBianchii
dBianchii / IsomorficT.ts
Created November 13, 2024 12:40
Automatic zod translations with with next-intl, tRPC, react-hook-form
//TODO: figure out how to make typed namespaces work. (Both with i18n-ally and next-intl/use-intl)
type TranslationKeys = never;
export type ServerSideT<S extends TranslationKeys = never> = Awaited<
ReturnType<typeof getTranslations<S>>
>;
export type ClientSideT<S extends TranslationKeys = never> = ReturnType<
typeof useTranslations<S>
>;
export type IsomorficT<S extends TranslationKeys = never> =
| ServerSideT<S>
import { useAtom } from "jotai/react";
import React, { useState, useCallback, useEffect } from "react";
import { colorValue } from "../atoms";
export default function AnimatedCircularProgressBar({
max = 100,
min = 0,
value,
className = "",
children,