You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mvfront-react/components/Logo.tsx

26 lines
735 B

import Image from 'next/image';
import Link from 'next/link';
import { useTranslation } from 'next-i18next';
import { getUrl, RouteTypes } from '@services/routes';
import logoWithText from '../public/logos/logo.svg';
import logo from '../public/logos/logo-footer.svg';
import { useRouter } from 'next/router';
interface LogoProps {
title?: boolean;
[props: string]: any;
}
const Logo = ({ title = true, ...props }: LogoProps) => {
const { t } = useTranslation();
const router = useRouter();
const src = title ? logoWithText : logo;
return (
<Link href={getUrl(RouteTypes.HOME, router).toString()}>
<Image src={src} alt={t('logo.alt')} className="d-block" {...props} />
</Link>
);
};
export default Logo;