import classNames from 'classnames'
import React from 'react'
import DisplayCurrency from 'components/common/DisplayCurrency'
import { ExclamationMarkTriangle } from 'components/common/Icons'
import Text from 'components/common/Text'
import WarningMessages from 'components/common/WarningMessages'
import useAllAssets from 'hooks/assets/useAllAssets'
import { BNCoin } from 'types/classes/BNCoin'
import { formatAmountWithSymbol, formatLeverage } from 'utils/formatters'
interface SubTitleProps {
text: string
color?: string
}
export function SubTitle(props: SubTitleProps) {
return (
{props.text}
)
}
interface CollateralSubTitleProps {
amount: BigNumber
denom: string
isOpen: boolean
warningMessages: string[]
}
export function CollateralSubTitle(props: CollateralSubTitleProps) {
const assets = useAllAssets()
if (props.isOpen) return null
if (!props.isOpen && props.amount.isZero()) {
return (
You have not provided any collateral.
)
}
return (
0 ? 'text-warning' : ''}
/>
)
}
interface LeveragedSubTitleProps {
isOpen: boolean
leverage: number
positionValue: BigNumber
warningMessages: string[]
}
export function LeverageSubTitle(props: LeveragedSubTitleProps) {
if (props.isOpen || props.leverage <= 1) return null
return (
0 ? 'text-warning' : ''}
/>
)
}
interface SelectAccountSubTitleProps {
isOpen: boolean
isSummaryOpen: boolean
selectedAccountId?: string
type: 'create' | 'select'
}
export function SelectAccountSubTitle(props: SelectAccountSubTitleProps) {
if (!props.isOpen && props.selectedAccountId) {
return (
Account {props.selectedAccountId}
)
}
if (!props.selectedAccountId && props.isSummaryOpen) {
return (
You need to {props.type} an account
)
}
return ''
}