I see that here you can come up with some kind of universal method for issuing an active class, but I just can’t figure out how to do it.
I would be very grateful for your help!
Logic
const engLangActive: string =
router.locale === "en"
? `${styles.langButton} ${styles.active}`
: styles.langButton;
const deLangActive: string =
router.locale === "de"
? `${styles.langButton} ${styles.active}`
: styles.langButton;
JSX
<>
<button className={engLangActive}>
EN
</button>
<button className={deLangActive}>
DE
</button>
</>