mirror of
https://github.com/theoludwig/theoludwig.git
synced 2024-11-05 04:51:30 +01:00
30 lines
548 B
TypeScript
30 lines
548 B
TypeScript
import setLanguage from 'next-translate/setLanguage'
|
|
|
|
interface LanguageButtonProps {
|
|
lang: string
|
|
}
|
|
|
|
export const LanguageButton: React.FC<LanguageButtonProps> = (props) => {
|
|
return (
|
|
<>
|
|
<span
|
|
onClick={async () => await setLanguage(props.lang)}
|
|
className='important'
|
|
>
|
|
{props.children}
|
|
</span>
|
|
|
|
<style jsx>
|
|
{`
|
|
span {
|
|
cursor: pointer;
|
|
}
|
|
span:hover {
|
|
text-decoration: underline;
|
|
}
|
|
`}
|
|
</style>
|
|
</>
|
|
)
|
|
}
|