@conduction/components
Version:
React (Gatsby) components used within the Conduction Skeleton Application (and its implementations)
7 lines (6 loc) • 818 B
JavaScript
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import * as styles from "./Tag.module.css";
import clsx from "clsx";
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
import { faXmark } from "@fortawesome/free-solid-svg-icons";
export const Tag = ({ label, icon, onClick, remove, layoutClassName }) => (_jsxs("div", { className: remove && styles.tagContainer, children: [_jsxs("div", { className: clsx(styles.tag, [layoutClassName && layoutClassName], onClick && styles.clickable, remove && styles.remove), onClick, children: [icon && _jsx("span", { children: icon }), _jsx("span", { children: label })] }), remove && (_jsx("div", { className: clsx(styles.tag, styles.removeTag), onClick: remove, children: _jsx("span", { children: _jsx(FontAwesomeIcon, { icon: faXmark }) }) }))] }));