import JobForm from './job-form' import Link from 'next/link' import Button from 'react-bootstrap/Button' import Alert from 'react-bootstrap/Alert' import AccordianItem from './accordian-item' import { useMe } from './me' import { useRouter } from 'next/router' import { DiscussionForm } from './discussion-form' import { LinkForm } from './link-form' import { PollForm } from './poll-form' import { BountyForm } from './bounty-form' import SubSelect from './sub-select-form' import { useCallback, useState } from 'react' import FeeButton, { FeeButtonProvider, postCommentBaseLineItems, postCommentUseRemoteLineItems } from './fee-button' import Delete from './delete' import CancelButton from './cancel-button' export function PostForm ({ type, sub, children }) { const me = useMe() const [errorMessage, setErrorMessage] = useState() const prefix = sub?.name ? `/~${sub.name}` : '' const checkSession = useCallback((e) => { if (!me) { e.preventDefault() setErrorMessage('you must be logged in') } }, [me, setErrorMessage]) if (!type) { return (