/** * WordPress dependencies */ import { TextControl } from '@safe-wordpress/components'; import { _x } from '@safe-wordpress/i18n'; /** * Internal dependencies */ import { useAttributes } from '../hooks'; import { DEFAULT_ATTRS } from './config'; import type { FieldSettingProps } from '../types'; export const GdprCookieSetting = ( { name: settingName, disabled, }: FieldSettingProps ): JSX.Element => { const [ attributes, setAttributes ] = useAttributes( settingName, DEFAULT_ATTRS ); const { name, value, _placeholder } = attributes; return (
setAttributes( { name: v } ) } disabled={ disabled } placeholder={ _placeholder || _x( 'Cookie Name', 'text', 'nelio-ab-testing' ) } /> { !! name && ( setAttributes( { value: v } ) } disabled={ disabled } placeholder={ _x( 'Optional Cookie Value', 'text', 'nelio-ab-testing' ) } /> ) }
); };