import {ViewContext} from '../../app';
import {useContext} from 'react';

const Attribute = ({name, value, id, removeHandler}) => {
    const {adminView} = useContext(ViewContext);

    return <tr>
        <td>{name}</td>
        <td>{value}</td>
        {adminView ? <td onClick={() => removeHandler(id)}>- Delete</td> : <></>}
    </tr>
}

export default Attribute;
