import React, { useState } from 'react';
import axios from 'axios';

export const Overview: React.FC = () => {
  const [msg, setMsg] = useState('LOADING');

  axios.get('http://localhost:3000/auth/user', {
    headers: {
      Authorization: `Bearer ${sessionStorage.getItem('token')}`,
    },
  }).then((data) => setMsg(data.data)).catch(() => setMsg('FAILED'));

  return <>OVERVIEW {msg}</>;
};
