import React from "react"; import { useTranslation } from "react-i18next"; import { I18nKey } from "#/i18n/declaration"; import { getRandomTip } from "#/utils/tips"; export function RandomTip() { const { t } = useTranslation(); const [randomTip, setRandomTip] = React.useState(getRandomTip()); // Update the random tip when the component mounts React.useEffect(() => { setRandomTip(getRandomTip()); }, []); return (

{t(I18nKey.TIPS$PROTIP)}:

{t(randomTip.key)} {randomTip.link && ( <> {" "} {t(I18nKey.TIPS$LEARN_MORE)} )}

); }