1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-12-08 00:44:30 +01:00
.profile/components/Footer.tsx

44 lines
1.2 KiB
TypeScript
Raw Normal View History

2021-07-27 13:36:35 +02:00
import { useMemo } from 'react'
import Link from 'next/link'
2021-04-18 01:56:23 +02:00
import useTranslation from 'next-translate/useTranslation'
2021-07-27 13:36:35 +02:00
export interface FooterProps {
version: string
}
export const Footer: React.FC<FooterProps> = (props) => {
2021-04-18 01:56:23 +02:00
const { t } = useTranslation()
2021-07-27 13:36:35 +02:00
const { version } = props
const versionLink = useMemo(() => {
if (version !== '0.0.0-development') {
return `https://github.com/Divlo/Divlo/releases/tag/v${version}`
}
return 'https://github.com/Divlo/Divlo/tree/develop'
}, [version])
2021-04-18 01:56:23 +02:00
return (
2021-07-27 13:36:35 +02:00
<footer className='bg-white flex flex-col items-center justify-center py-6 text-lg border-t-2 border-gray-600 dark:border-gray-400 dark:bg-black'>
<p>
2021-07-27 13:36:35 +02:00
<Link href='/'>
<a className='hover:underline text-yellow dark:text-yellow-dark'>
Divlo
</a>
</Link>{' '}
| {t('common:allRightsReserved')}
</p>
<p className='mt-1'>
Version{' '}
<a
className='hover:underline text-yellow dark:text-yellow-dark'
href={versionLink}
target='_blank'
rel='noopener noreferrer'
>
{version}
</a>
</p>
</footer>
2021-04-18 01:56:23 +02:00
)
}