import React from 'react'; import { default as RCFooter, FooterProps as RcFooterProps } from 'rc-footer'; import { useTranslation } from 'react-i18next'; // import { Icon } from 'antd'; import styles from './Footer.module.less'; import 'rc-footer/assets/index.less'; interface FooterProps extends RcFooterProps { rootDomain?: string; language?: string; githubUrl?: string; footerLinks?: FooterProduct[]; bottomLinks?: FooterItem[]; hiddenThemeAuthor?: boolean; siteCopyright?: string; columns?: Array; } interface FooterItem { title: string; url?: string; icon?: string; description?: string; openExternal?: boolean; } interface FooterProduct { title: string; icon?: string; slogan?: string; items?: FooterItem[]; } const Footer: React.FC = ({ columns, theme = 'dark', language, footerLinks = [], bottomLinks = [], hiddenThemeAuthor = false, siteCopyright, }) => { const { t, i18n } = useTranslation(); const lang = language || i18n.language; // eslint-disable-next-line no-console console.log('lang:', lang); const defaultColumns = footerLinks.map((product: FooterProduct) => ({ title: ( {t(product.title)} {t(product.slogan || '')} ), items: (product.items || []).map((item: FooterItem) => ({ ...item, title: t(item.title), description: t(item.description || ''), icon: more products, })), })); return (
{bottomLinks.map(item => ( {item.icon ? ( {item.title} ) : ( t(item.title) )} ))}
{siteCopyright || ''}
{!hiddenThemeAuthor ? (
Made with ❤ by{' '} Hansinhu
) : null}
) : null } /> ); }; export default Footer;