 // LIBRARIES
 import React, { Component } from 'react';
 import { Menu, Dropdown, notification, Icon, message } from "antd"
 import { connect } from "react-redux";
 import { Link } from 'react-router-dom'
 
 // COMPONENTS
 import AdvanceTable from "components/StationTables";
 import HeaderForm from "components/Forms/HeaderForm";
 
 // HELPER FUNCTIONS
 import { API_UNI_OIL } from "utils/Api";
 import { customAction } from 'actions';
import moment from 'moment'

 
 class StationLocator extends Component {
	 state= {
		 updating: false,
	 }
 
	 delete =(admin_uuid)=> {
		 alert('as')
	 }
 
	 updateDropDown = async(e) => {
		
	 }
 
	 render() {
		 const { match, history } = this.props;
 
		 return (
			 <div style={{border:'1px solid #E6ECF5'}}>
				 <HeaderForm
          title='Fuel List'
          action={()=> history.push({ pathname: `${match.url}/create` })}
          actionBtnName='Add fuel'
        />
				 <AdvanceTable 
          updating = { this.state.updating }
          keyValue="cardtype_uuid"
          url={{ 
            default: 'fuels',
            // defaultWithFilter: 'member?_sort_by=card_number&_sort_order=asc',
            // filter: '?page=1&page_size=10&_sort_by=create_dt&_sort_order=desc'
          }}
          filterValues ={["role", "status"]}
          columns={
            [
              {
                title: 'Fuel Name',
                dataIndex: 'name',
                key: 'fuelName',
                // width: 120,
                // sorter: true,
                filters:[],
              },
              {
                title: 'Date Created',
                dataIndex: 'createdAt',
                render: value => {
                  return <span>{moment(value).format('LLL')}</span>
                },
                key: 'dateCreated',
                // sorter: true,
                filters:[],
              },
              {
                title: 'Date Modified',
                dataIndex: 'updatedAt',
                render: value => {
                  return <span>{moment(value).format('LLL')}</span>
                },
                key: 'dateModified',
                // sorter: true,
                filters:[],
              },
              {
                title: 'Action',
                dataIndex: 'action',
                key: 'action',
                width: 80,
                buttons: [
                  {
                    key: 'edit',
                    title: "Edit",
                    icon: 'form',
                    url: '',
                  },
                  {
                    key: 'delete',
                    title: "Delete",
                    icon: 'delete',
                    url: '',
                    action: this.delete
                  }
                ]
              },
            ]
          }
        />
        <div></div>
			 </div>
		 );
	 }
 }
 
 StationLocator = connect(
	 state => ({
		 //user: state.viewUser.data,
		 //status: state.viewUser.code,
		 //responseMsg: state.viewUser.messages
	 }),
	 { customAction }
 )(StationLocator);
 
 export default StationLocator;