/** * WordPres dependencies */ import { _x } from '@safe-wordpress/i18n'; /** * External dependencies */ import { NumberControl } from '@nelio-content/components'; import type { EditorialTask } from '@nelio-content/types'; /** * Internal dependencies */ import { BackButton } from './back-button'; type DateValue = EditorialTask[ 'dateValue' ]; export type NegativeDaysProps = { readonly dateValue: DateValue; readonly disabled?: boolean; readonly setDateValue: ( value: DateValue ) => void; }; export const NegativeDays = ( { disabled, dateValue, setDateValue, }: NegativeDaysProps ): JSX.Element => (
setDateValue( stringify( val ) ) } />
); // ======= // HELPERS // ======= const stringify = ( n?: number ) => ( undefined === n ? '' : `${ n }` );