1
0
ohmyform/ui/components/form/layouts/page.buttons.tsx
Michael Schramm 9c4c325e5a
Switch to single branch (#221)
* remove submodules
* add api and ui files
* update github actions
* use sparse checkout
* update node setup
* update checkout
* update docker
* change permissions
* update mariadb health check
* update changelog
2023-12-02 19:22:40 +01:00

35 lines
812 B
TypeScript

import { Space } from 'antd'
import React from 'react'
import { FormPublicPageButtonFragment } from '../../../graphql/fragment/form.public.fragment'
import { StyledButton } from '../../styled/button'
interface Props {
buttons: FormPublicPageButtonFragment[]
}
export const PageButtons: React.FC<Props> = ({ buttons }) => {
if (buttons.length === 0) {
return null
}
return (
<Space>
{buttons.map((button, key) => {
return (
<StyledButton
background={button.bgColor}
color={button.color}
highlight={button.activeColor}
key={key}
href={button.url}
target={'_blank'}
rel={'noreferrer'}
>
{button.text}
</StyledButton>
)
})}
</Space>
)
}