/** @jsx jsx */
import { jsx } from 'theme-ui'

import React from 'react'

export interface IconProps {
    name: string
}

export const Icon: React.FunctionComponent<IconProps> = (props) => {
    return (
        <svg
            {...props}
            style={{
                width: '1em',
                height: '1em',
                verticalAlign: '-0.15em',
                overflow: 'hidden',
                fill: 'currentColor'
            }}
        >
            <use xlinkHref={`#${props.name}`} />
        </svg>
    )
}
