import { Form, Input, MarkdownInput, SubmitButton } from '../components/form' import { useRouter } from 'next/router' import { gql, useApolloClient, useMutation } from '@apollo/client' import TextareaAutosize from 'react-textarea-autosize' import Countdown from './countdown' import AdvPostForm, { AdvPostInitial } from './adv-post-form' import FeeButton, { EditFeeButton } from './fee-button' import { InputGroup } from 'react-bootstrap' import { bountySchema } from '../lib/validate' import { SubSelectInitial } from './sub-select-form' export function BountyForm ({ item, sub, editThreshold, titleLabel = 'title', bountyLabel = 'bounty', textLabel = 'text', buttonText = 'post', adv, handleSubmit, children }) { const router = useRouter() const client = useApolloClient() const schema = bountySchema(client) const [upsertBounty] = useMutation( gql` mutation upsertBounty( $sub: String $id: ID $title: String! $bounty: Int! $text: String $boost: Int $forward: String ) { upsertBounty( sub: $sub id: $id title: $title bounty: $bounty text: $text boost: $boost forward: $forward ) { id } } ` ) return (
) }