import { useState } from 'react' import { Form, useActionData, useNavigation } from 'react-router-dom' import { CheckboxFieldUncontrolled, InputField, InputFieldUncontrolled } from '../../components/Inputs' import { ProfileSection } from '../../components/ProfileSection' import { useAppSelector } from '../../hooks' import { BlogFormErrors } from 'types' import '../../styles/innerPage.css' import '../../styles/styles.css' import '../../styles/write.css' import { LoadingSpinner } from 'components/LoadingSpinner' export const WritePage = () => { const userState = useAppSelector((state) => state.user) const formErrors = useActionData() as BlogFormErrors const navigation = useNavigation() const title = 'Submit a blog post' const [content, setContent] = useState('') const handleContentChange = (_: string, value: string) => { setContent(value) } return (

{title}

{navigation.state === 'loading' && ( )} {navigation.state === 'submitting' && ( )}
{userState.auth && userState.user?.pubkey && ( )}
) }