import classNames from 'classnames';
import { jsxs as _jsxs, Fragment as _Fragment, jsx as _jsx } from "react/jsx-runtime";
export const NoteBoxQuotation = props => {
  const {
    author,
    children,
    citation,
    className
  } = props;
  const classes = classNames('ds-c-note-box-quotation', className);
  const CaptionContent = () => {
    // We want to prioritize citations over authors, so if both are present only render the citation.
    if (citation) {
      return /*#__PURE__*/_jsxs("cite", {
        className: "ds-c-note-box-quotation--citation",
        children: [`\u2014`, " ", citation]
      });
    }
    // If citation is not present, but author is, render the author.
    if (author) {
      return /*#__PURE__*/_jsxs(_Fragment, {
        children: [`\u2014`, " ", author]
      });
    }
    if (process.env.NODE_ENV !== 'production') {
      if (!citation && !author) {
        console.warn(`[Warning]: You must include either an author prop or a citation prop on your NoteBoxQuotation component.`);
      }
    }
    return null;
  };
  return /*#__PURE__*/_jsxs("figure", {
    className: classes,
    children: [/*#__PURE__*/_jsx("blockquote", {
      className: "ds-c-note-box-quotation--blockquote",
      children: children
    }), /*#__PURE__*/_jsx("figcaption", {
      className: "ds-c-note-box-quotation--caption",
      children: /*#__PURE__*/_jsx(CaptionContent, {})
    })]
  });
};