import React from 'react';
import Footer, { FooterProps } from '@digigov/react-core/Footer';
import FooterContainer from '@digigov/react-core/FooterContainer';
import FooterInfo from '@digigov/react-core/FooterInfo';
import FooterInfoSection from '@digigov/react-core/FooterInfoSection';
import Copyright from '@digigov/ui/govgr/Footer/Copyright';
import HellenicRepublicLogo from '@digigov/ui/govgr/Footer/HellenicRepublicLogo';

export interface GovGRFooterProps extends FooterProps {
  copyright?: React.ReactNode;
  minDigitalCopyright?: boolean;
  license?: string;
  openSource?: string;
  children?: React.ReactNode;
  createdBy?: React.ReactNode;
  className?: string;
}
export const GovGRFooter: React.FC<GovGRFooterProps> = ({
  copyright,
  children,
  createdBy,
  minDigitalCopyright,
}: GovGRFooterProps) => {
  return (
    <Footer>
      <FooterContainer>
        {children || (
          <FooterInfo>
            <FooterInfoSection>
              {copyright ? (
                copyright
              ) : (
                <Copyright
                  createdBy={createdBy}
                  minDigitalCopyright={minDigitalCopyright}
                />
              )}
            </FooterInfoSection>
            <FooterInfoSection>
              <HellenicRepublicLogo />
            </FooterInfoSection>
          </FooterInfo>
        )}
      </FooterContainer>
    </Footer>
  );
};

export default GovGRFooter;
