import { Colors, Variants } from '../../styles'; import { Icon } from '../../surface'; import * as React from 'react'; import { StyledLabel, StyledUploadButton, Image } from './styled-upload-button'; interface Props { accept: string; label?: React.ReactNode; name: string; onChange: () => void; style?: React.CSSProperties; multiple?: boolean; type: 'button' | 'circle-image' | 'square-image'; src?: string; alignCenter?: boolean; variant: Variants; color: Colors; } const UploadButton = (props: Props) => { const hasImage = props.type !== 'button'; const alignCenter = { width: '100%', display: 'flex', alignItems: 'center', justifyContent:'center', }; return(
{hasImage && } {props.type === 'square-image' && } {!(hasImage && props.src) && {props.label} }
); }; UploadButton.defaultProps = { type: 'button', variant: 'outlined', color: 'primary', accept: '*', onChange: (e: any) => {}, }; export default UploadButton;