20 lines
714 B
JavaScript
Raw Normal View History

2021-10-26 15:49:37 -05:00
import { ITEM } from '../../../fragments/items'
import { getGetServerSideProps } from '../../../api/ssrApollo'
2021-08-11 15:13:10 -05:00
import { DiscussionForm } from '../../../components/discussion-form'
import { LinkForm } from '../../../components/link-form'
import LayoutCenter from '../../../components/layout-center'
export const getServerSideProps = getGetServerSideProps(ITEM, null, 'item')
2021-08-11 15:13:10 -05:00
2021-10-26 15:49:37 -05:00
export default function PostEdit ({ data: { item } }) {
2021-08-11 15:13:10 -05:00
const editThreshold = new Date(item.createdAt).getTime() + 10 * 60000
return (
<LayoutCenter>
{item.url
? <LinkForm item={item} editThreshold={editThreshold} />
: <DiscussionForm item={item} editThreshold={editThreshold} />}
</LayoutCenter>
)
}