/* eslint-disable @typescript-eslint/no-explicit-any */ import { currentUser } from '@stores/currentUser'; import { useStore } from '@nanostores/react'; import * as Dialog from '@radix-ui/react-dialog'; import * as commands from '@uiw/react-md-editor/lib/commands'; import dynamic from 'next/dynamic'; import { dateToUnix, useNostr } from 'nostr-react'; import { getEventHash, signEvent } from 'nostr-tools'; import { useState } from 'react'; const MDEditor = dynamic(() => import('@uiw/react-md-editor').then((mod) => mod.default), { ssr: false, }); export default function CreatePost() { const { publish } = useNostr(); const [value, setValue] = useState(''); const $currentUser: any = useStore(currentUser); const pubkey = $currentUser.pubkey; const privkey = $currentUser.privkey; const postButton = { name: 'post', keyCommand: 'post', buttonProps: { className: 'cta-btn', 'aria-label': 'Post a message' }, icon: (