import { clsx } from "clsx"; import { FC, HTMLAttributes } from "react"; import { FormatUtils } from "@dndbeyond/character-rules-engine/es"; import styles from "./styles.module.css"; interface Props extends HTMLAttributes { sourceName?: string | null; sourceNames?: Array; url?: string; description?: string | null; className?: string; } export const MarketplaceCta: FC = ({ sourceName = null, sourceNames, url = "/marketplace", description = null, className, ...props }) => { const allSourceNames: Array = []; if (sourceName) { allSourceNames.push(sourceName); } if (sourceNames) { allSourceNames.push(...sourceNames); } return (
{allSourceNames.length > 0 && (
Available in
{FormatUtils.renderNonOxfordCommaList(allSourceNames)}
)} {description && (
{description}
)}
Go To Marketplace
); };