/*
 * Copyright (c) Facebook, Inc. and its affiliates.
 * Copyright (c) 2024 Kristóf Marussy <kristof@marussy.com>
 *
 * SPDX-License-Identifier: MIT
 *
 * This file was derived from
 * https://github.com/facebook/docusaurus/blob/cc0bceab9c1678303f6237f5526753edc1b12fc3/packages/docusaurus-theme-classic/src/theme/Footer/Copyright/index.tsx
 * via the `swizzle` mechanism of Docusaurus.
 *
 * It was modified to embed JSX content directly in the footer.
 */

import Link from '@docusaurus/Link';
import type { Props } from '@theme/Footer/Copyright';
import clsx from 'clsx';
import React from 'react';

import { CCLicenseLink, LicenseLink } from '@site/src/components/licenses';

import styles from './Copyright.module.css';

export default function FooterCopyright({ copyright }: Props) {
  return (
    <div className="footer__copyright">
      Most content on this site is{' '}
      <CCLicenseLink
        to="/license#content"
        rel="license"
        className={clsx(styles.link, styles['link--license'])}
      >
        CC-BY-4.0
      </CCLicenseLink>
      . The{' '}
      <Link to="https://git.marussy.com/blog/" className={styles.link}>
        code for this site
      </Link>{' '}
      is{' '}
      <LicenseLink
        to="/license#code"
        rel="license"
        className={clsx(styles.link, styles['link--license'])}
      >
        MIT
      </LicenseLink>
      .<br />
      <span dangerouslySetInnerHTML={{ __html: copyright }} />
    </div>
  );
}
