import { redirectPage } from '@nanostores/router' import { Meta } from '../context/meta' import { clsx } from 'clsx' import { AuthGuard } from '../components/AuthGuard' import { Button } from '../components/_shared/Button' import { Icon } from '../components/_shared/Icon' import { PageLayout } from '../components/_shared/PageLayout' import { useLocalize } from '../context/localize' import { apiClient } from '../graphql/client/core' import { router } from '../stores/router' import { getImageUrl } from '../utils/getImageUrl' import { LayoutType } from './types' import styles from '../styles/Create.module.scss' const handleCreate = async (layout: LayoutType) => { const shout = await apiClient.createArticle({ article: { layout: layout } }) redirectPage(router, 'edit', { shoutId: shout.id.toString(), }) } export const CreatePage = () => { const { t } = useLocalize() const ogImage = getImageUrl('production/image/logo_image.png') const ogTitle = t('Choose a post type') const description = t('Participate in the Discours: share information, join the editorial team') return (

{t('Choose a post type')}

  • handleCreate('article')}>
    {t('article')}
  • handleCreate('literature')}>
    {t('literature')}
  • handleCreate('image')}>
    {t('images')}
  • handleCreate('audio')}>
    {t('music')}
  • handleCreate('video')}>
    {t('video')}
) } export const Page = CreatePage