import { Form, MarkdownInput } from '@/components/form' import styles from './reply.module.css' import { commentSchema } from '@/lib/validate' import { FeeButtonProvider } from './fee-button' import { ItemButtonBar } from './post' import { UPDATE_COMMENT } from '@/fragments/paidAction' import useItemSubmit from './use-item-submit' export default function CommentEdit ({ comment, editThreshold, onSuccess, onCancel }) { const onSubmit = useItemSubmit(UPDATE_COMMENT, { paidMutationOptions: { update (cache, { data: { upsertComment: { result } } }) { if (!result) return cache.modify({ id: `Item:${comment.id}`, fields: { text () { return result.text } } }) } }, item: comment, navigateOnSubmit: false, onSuccessfulSubmit: onSuccess }) return (