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

const ListItem = ({ i18n, data, delWristband, editWristband, showPathInfo }) => {

    return (
        <Table.Row>
            <Table.Cell>
                <Button content="Edit" basic onClick={()=>{editWristband(1, data)}} />
                <Button content="Delete" basic onClick={()=>{delWristband(data.uid)}} />
                <Button content="地點紀錄" basic onClick={()=>{showPathInfo(data.mac, data.name)}} />
            </Table.Cell>
            <Table.Cell>{data.mac}</Table.Cell>
            <Table.Cell>{data.name}</Table.Cell>
            <Table.Cell>{data.identity}</Table.Cell>
            <Table.Cell>{data.monitor == 1 ? '啟用' : '停用'}</Table.Cell>
            <Table.Cell>{data.notify == 1 ? '啟用' : '停用'}</Table.Cell>
            <Table.Cell>{data.switch == 1 ? '啟用' : '停用'}</Table.Cell>
        </Table.Row>
    )
}

export default ListItem;