misc_pterodactyl-panel/resources/scripts/components/elements/Translate.tsx

17 lines
375 B
TypeScript
Raw Permalink Normal View History

2022-11-25 20:25:03 +00:00
import type { TransProps } from 'react-i18next';
import { Trans, useTranslation } from 'react-i18next';
2022-11-25 20:25:03 +00:00
type Props = Omit<TransProps<string, string>, 't'>;
2022-11-25 20:25:03 +00:00
function Translate({ ns, children, ...props }: Props) {
const { t } = useTranslation(ns);
return (
<Trans t={t} {...props}>
{children}
</Trans>
);
2022-11-25 20:25:03 +00:00
}
export default Translate;