/** * WordPres dependencies */ import { _x } from '@safe-wordpress/i18n'; /** * External dependencies */ import { NumberControl } from '@nelio-content/components'; import type { TaskTemplate } from '@nelio-content/types'; /** * Internal dependencies */ import { BackButton } from './back-button'; type DateValue = TaskTemplate[ '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 ) ) } /> { _x( 'days before pub.', 'text', 'nelio-content' ) }
); // ======= // HELPERS // ======= const stringify = ( n?: number ) => ( undefined === n ? '' : `${ n }` );