import React from 'react';

import { PageWrap } from '../PageWrap';
import { Link } from '../Link';
import { Paragraph } from '../Paragraph';
import * as sc from './styles';

type variants = 'default' | 'transparent';

export interface FooterProps {
  title?: string;
  termsOfServiceUrl?: string;
  privacyPolicyUrl?: string;
  variant: variants;
}

export const Footer = (props: FooterProps) => {
  return (
    <PageWrap>
      <sc.Wrapper className="pui-footer" variant={props.variant}>
        <sc.Inner>
          <Paragraph as="span" mb={0} fontSize="1">
            &copy; {new Date().getFullYear()} {props.title || 'Polymath Inc'}
          </Paragraph>
          <sc.Links variant={props.variant}>
            <li>
              <Link
                href={
                  props.termsOfServiceUrl ||
                  'https://polymath.network/termsofservice.html'
                }
              >
                Terms Of Service
              </Link>
            </li>
            <li>
              <Link
                href={
                  props.privacyPolicyUrl ||
                  'https://polymath.network/privacypolicy.html'
                }
              >
                Privacy Policy
              </Link>
            </li>
          </sc.Links>
        </sc.Inner>
      </sc.Wrapper>
    </PageWrap>
  );
};

Footer.defaultProps = {
  variant: 'default',
};
