import React from 'react'; import PropTypes from 'prop-types'; import { Box, Text } from '../../../components/component-library'; import ToggleButton from '../../../components/ui/toggle-button'; import { JustifyContent, TextVariant, AlignItems, Display, } from '../../../helpers/constants/design-system'; import { useI18nContext } from '../../../hooks/useI18nContext'; export const Setting = ({ value, setValue, title, description, showToggle = true, }) => { const t = useI18nContext(); return (
{title} {description}
{showToggle ? (
setValue(!val)} offLabel={t('off')} onLabel={t('on')} />
) : null}
); }; Setting.propTypes = { value: PropTypes.bool, setValue: PropTypes.func, title: PropTypes.string, description: PropTypes.oneOfType([PropTypes.object, PropTypes.string]), showToggle: PropTypes.bool, };