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

const IOPanelListItem = ({i18n, data, ioModal, delIOList, showAIOSet}) => {

	return (
		<Table.Row>
			<Table.Cell>{data.addr}</Table.Cell>
			<Table.Cell>{data.num}</Table.Cell>
			<Table.Cell>
				<Button type="button" basic content="修改" onClick={()=>{ioModal(1, data)}}/>
				<Button type="button" basic content="刪除" onClick={()=>{delIOList(data.uid || '')}}/>
				{
					data.type == 3 || data.type == 4 ? 
					(
						<Button type="button" basic content="顯示設定" onClick={()=>{showAIOSet(data.uid)}} />
					):null
				}
			</Table.Cell>
		</Table.Row>
	)
}

export default IOPanelListItem;