/* * Copyright (c) 2020 CZ.NIC z.s.p.o. (http://www.nic.cz/) * * This is free software, licensed under the GNU General Public License v3. * See /LICENSE for more information. */ import React from "react"; import PropTypes from "prop-types"; import { useUID } from "react-uid"; Switch.propTypes = { label: PropTypes.oneOfType([ PropTypes.string, PropTypes.element, PropTypes.node, PropTypes.arrayOf(PropTypes.node), ]).isRequired, helpText: PropTypes.string, switchHeading: PropTypes.bool, }; export function Switch({ label, helpText, switchHeading, ...props }) { const uid = useUID(); return (
{helpText && ( {helpText} )}
); }