aboutsummaryrefslogtreecommitdiffstats
path: root/packages/website/ts/@next/components/icon.tsx
blob: 10916f28ee8a1aa67571c91da26e670801f812b9 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import * as React from 'react';
import styled from 'styled-components';

interface Props {
    icon: any;
    size?: any;
}

const StyledIcon = styled.div`
    margin: auto;
    flex-shrink: 0;

    ${(props: Props) => props.size && `
    width: ${props.size}; height: auto;
    `}
`;

export const Icon: React.StatelessComponent = ({ icon, ...props }) => (
    <>
        <StyledIcon as={icon as 'svg'} {...props} />
    </>
);