import React , { FC } from 'react' ; import { useDrag } from 'react-dnd' ; import FieldIcon from '../../../../../../common/component/FieldIcon' ; interface Props { field : { id : string ; name : string ; } ; } const FieldItem = props => { const { field } = props ; const [ _ , dragRef ] = useDrag ( { item : { type : 'FIELD' , id : field . id } } ) ; return ( < div className = "item" ref = { dragRef } > < FieldIcon /> < span > { field . name } < /span> < /div>); } ; export default FieldItem ;