import React from 'react';
import {List, Button, Icon} from 'semantic-ui-react';

const DeviceListItem = ({i18n, idx, data, delModbus, editModbus, showDev, selectDevToShow}) =>{

	return (
		<List.Item active={data.uid == showDev}>
			<span style={{cursor: 'pointer'}} onClick={() => {
					selectDevToShow(data.uid);
				}}>
				{data.name} / Node:{data.node}
			</span>
			<Icon style={{cursor: 'pointer'}} name="trash" onClick={()=>{delModbus(data.uid || '')}}/>
			<Icon style={{cursor: 'pointer'}} name="write" onClick={()=>{editModbus(1, data)}}/>
		</List.Item>
	)
}

export default DeviceListItem;