import { Meta } from '@solidjs/meta' import { useNavigate } from '@solidjs/router' import { clsx } from 'clsx' import { createMemo } from 'solid-js' import { AuthGuard } from '~/components/AuthGuard' import { Button } from '~/components/_shared/Button' import { Icon } from '~/components/_shared/Icon' import { PageLayout } from '~/components/_shared/PageLayout' import { useGraphQL } from '~/context/graphql' import { useLocalize } from '~/context/localize' import createShoutMutation from '~/graphql/mutation/core/article-create' import enKeywords from '~/lib/locales/en/keywords.json' import ruKeywords from '~/lib/locales/ru/keywords.json' import styles from '~/styles/Create.module.scss' import { LayoutType } from '~/types/common' import { getImageUrl } from '~/utils/getImageUrl' export default () => { const { t, lang } = useLocalize() const ogImage = getImageUrl('production/image/logo_image.png') const ogTitle = createMemo(() => t('Choose a post type')) const description = createMemo(() => t('Participate in the Discours: share information, join the editorial team') ) const client = useGraphQL() const navigate = useNavigate() const handleCreate = async (layout: LayoutType) => { const result = await client.mutation(createShoutMutation, { article: { layout: layout } }).toPromise() if (result) { const shout = result.data.create_shout if (shout?.id) navigate(`/edit/${shout.id}`) } } 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')}
) }