import JobForm from './job-form'
import Link from 'next/link'
import { Button } from 'react-bootstrap'
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 Info from './info'
function FreebieDialog () {
return (
you have no sats, so this one is on us
Free posts have limited visibility and are hidden on the recent tab until other stackers zap them.
Free posts will not cover posts that cost more than 1 sat.
To get fully visibile and unrestricted posts right away, fund your account with a few sats or earn some on Stacker News.
)
}
export function PostForm ({ type, sub, children }) {
const me = useMe()
const prefix = sub?.name ? `/~${sub.name}` : ''
if (!type) {
return (
{me?.sats < 1 && }
or
more types
}
body={
or
}
/>
)
}
let FormType = JobForm
if (type === 'discussion') {
FormType = DiscussionForm
} else if (type === 'link') {
FormType = LinkForm
} else if (type === 'poll') {
FormType = PollForm
} else if (type === 'bounty') {
FormType = BountyForm
}
return {children}
}
export default function Post ({ sub }) {
const router = useRouter()
let type = router.query.type
if (sub?.postTypes?.length === 1) {
type = sub.postTypes[0].toLowerCase()
}
return (
<>
{sub?.name !== 'jobs' && }
>
)
}