/** * WordPress dependencies */ import { __ } from '@wordpress/i18n'; import { TextareaControl } from '@wordpress/components'; import type { Attachment, Updatable } from '@wordpress/core-data'; import type { Field } from '@wordpress/dataviews'; /** * Internal dependencies */ import { getRawContent } from '../utils/get-raw-content'; const descriptionField: Partial< Field< Updatable< Attachment > > > = { id: 'description', type: 'text', label: __( 'Description' ), getValue: ( { item } ) => getRawContent( item?.description ), render: ( { item } ) => (
{ getRawContent( item?.description ) || '-' }
), Edit: ( { field, onChange, data } ) => { return ( onChange( { description: value } ) } rows={ 5 } /> ); }, enableSorting: false, filterBy: false, }; export default descriptionField;