import React from 'react';
import feather from 'feather-icons';

const WWW_ROOT: string = process.env.REACT_APP_WWW_ROOT!;

const ic = feather.icons.circle;


export type TIcon = 
{
    name: string,
    icon: JSX.Element
};

const IconArray: TIcon[] =
[
    {
        name: "user",
        icon: 
          <img style={{background: 'none'}}
            src = {WWW_ROOT+'uploads/user.svg'} 
            width='32px' 
            height='32px'
          />
    },
    {
        name: "grid",
        icon: 
          <img style={{background: 'none'}}
            src = {WWW_ROOT+'uploads/grid.svg'}
            width='32px' 
            height='32px'
          />
    },
    {
        name: "user-minus",
        icon: 
          <img style={{background: 'none'}} 
            src = {WWW_ROOT+'uploads/user-minus.svg'}
            width='32px' 
            height='32px'
            />
    },
    {
        name: "log-in",
        icon: 
          <img style={{background: 'none'}} 
            src = {WWW_ROOT+'uploads/log-in.svg'}
            width='32px' 
            height='32px'
            />
    },
    {
        name: "log-out",
        icon: 
          <img style={{background: 'none'}} 
            src = {WWW_ROOT+'uploads/log-out.svg'}
            width='32px' 
            height='32px'
          />
    },
    {
        name: "lock",
        icon: 
          <img style={{background: 'none'}}
            src = {WWW_ROOT+'uploads/lock.svg'}
            width='32px' 
            height='32px'
            />  
    }
];


export function IconUser() 
{
  return (
    IconArray.find((i) => i.name === 'user')!.icon  )
}

export function IconUserMinus() 
{
  return (
    IconArray.find((i) => i.name === 'user-minus')!.icon  )
}

export function IconLogIn() 
{
  return (
    IconArray.find((i) => i.name === 'log-in')!.icon  )
}

export function IconLogOut() 
{
  return (
    IconArray.find((i) => i.name === 'log-out')!.icon  )
}

export function IconLock() 
{
  return (
    IconArray.find((i) => i.name === 'lock')!.icon  )
}

export function IconGrid() 
{
  return (
    IconArray.find((i) => i.name === 'grid')!.icon  )
}
