import React from 'react';
import {Table} from 'semantic-ui-react';
import {convertTime} from '../../../../tools';

const ListItem = ({i18n, data}) => {

    return (
        <Table.Row>
            <Table.Cell>{data.mac}</Table.Cell>
            <Table.Cell>{data.locname ? data.locname : data.last_locname}</Table.Cell>
            <Table.Cell>{data.val3 ? parseInt(data.val3, 16) : ''}</Table.Cell>
            <Table.Cell>{data.val4 ? `${parseInt(data.val4, 16)}%` : ''}</Table.Cell>
            <Table.Cell>{data.val2 ? `${parseInt(data.val2, 16)}` : ''}</Table.Cell>
            <Table.Cell>{data.val5 ? `${parseInt(data.val5, 16)}` : ''}</Table.Cell>
            <Table.Cell>{data.val6 ? `${parseInt(data.val6, 16)}` : ''}</Table.Cell>
            <Table.Cell>{data.val7 ? `${parseInt(data.val7, 16)}` : ''}</Table.Cell>
            <Table.Cell>{data.val9 ? `${parseInt(data.val9, 16)}` : ''}</Table.Cell>
            <Table.Cell>{data.timestamp ? convertTime(data.timestamp, true) : ''}</Table.Cell>
        </Table.Row>
    )
}

export default ListItem;