import React, { FC, ReactNode } from 'react' import { Icon, __experimentalItem as Item } from '@wordpress/components' import { chevronRight } from '@wordpress/icons' import { Badge, Stack, Text } from '@wordpress/ui' import { useI18n } from '@wordpress/react-i18n' export declare interface SettingsRowProps { icon: React.ComponentProps['icon'] title: string description?: ReactNode on?: boolean onClick?: () => void children?: ReactNode extra?: ReactNode } const SettingsRow: FC = ({ icon, title, description, on, onClick, children, extra, }) => { const { __ } = useI18n() return ( {title} {on !== undefined && ( {on ? __('On', 'posten-bring-checkout') : __('Off', 'posten-bring-checkout')} )} {description && (
{description}
)}
{children} {onClick && }
{extra &&
{extra}
}
) } export default SettingsRow