import clsx from 'clsx'
import React from 'react'
import { Row } from './layout/row'
import { ConfirmationButton } from './confirmation-button'
import { ExclamationIcon } from '@heroicons/react/solid'
import { formatMoney } from 'common/util/format'
import { Button, ColorType, SizeType } from './button'
import { capitalize } from 'lodash'
export function WarningConfirmationButton(props: {
amount: number | undefined
marketType: 'freeResponse' | 'binary'
warning?: string
onSubmit?: () => void
disabled: boolean
isSubmitting: boolean
openModalButtonClass?: string
color: ColorType
size: SizeType
actionLabel?: string
}) {
const {
amount,
onSubmit,
warning,
disabled,
isSubmitting,
openModalButtonClass,
size,
color,
actionLabel,
} = props
const label = capitalize(actionLabel) ?? 'Wager'
const buttonText = isSubmitting
? 'Submitting...'
: amount
? `${label} ${formatMoney(amount)}`
: label
if (!warning) {
return (
)
}
return (
Whoa, there!
{warning}
)
}