You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
33 lines
928 B
33 lines
928 B
import React from 'react'; |
|
import { Box, Typography } from '@material-ui/core'; |
|
|
|
export interface IProps { |
|
children: any, |
|
} |
|
|
|
export default function QBOrBlock(props: any) { |
|
const firstChild = Array.isArray(props.children) && props.children.length >= 1 ? |
|
props.children[0] : undefined; |
|
|
|
const otherChildren = Array.isArray(props.children) && props.children.length > 1 ? |
|
props.children.slice(1) : []; |
|
|
|
return <Box |
|
display="flex" |
|
alignItems="center" |
|
> |
|
<Box m={1}> |
|
{firstChild} |
|
</Box> |
|
{otherChildren.map((child: any, idx: number) => { |
|
return <Box display="flex" alignItems="center" key={idx}> |
|
<Box m={1}> |
|
<Typography variant="button">Or</Typography> |
|
</Box> |
|
<Box m={1}> |
|
{child} |
|
</Box> |
|
</Box>; |
|
})} |
|
</Box> |
|
} |