import { Form, Input, MarkdownInput } from '@/components/form' import { useApolloClient } from '@apollo/client' import Countdown from './countdown' import AdvPostForm, { AdvPostInitial } from './adv-post-form' import InputGroup from 'react-bootstrap/InputGroup' import { bountySchema } from '@/lib/validate' import { SubSelectInitial } from './sub-select' import { normalizeForwards } from '@/lib/form' import { MAX_TITLE_LENGTH } from '@/lib/constants' import { useMe } from './me' import { ItemButtonBar } from './post' import useItemSubmit from './use-item-submit' import { UPSERT_BOUNTY } from '@/fragments/paidAction' export function BountyForm ({ item, sub, editThreshold, titleLabel = 'title', bountyLabel = 'bounty', textLabel = 'text', handleSubmit, children }) { const client = useApolloClient() const me = useMe() const schema = bountySchema({ client, me, existingBoost: item?.boost }) const onSubmit = useItemSubmit(UPSERT_BOUNTY, { item, sub }) const storageKeyPrefix = item ? undefined : 'bounty' return (
) }