import { For, Show, createMemo } from 'solid-js' import type { Shout, Topic } from '../../graphql/types.gen' import Row3 from '../Feed/Row3' import Row2 from '../Feed/Row2' import Beside from '../Feed/Beside' import { ArticleCard } from '../Feed/Card' import '../../styles/Topic.scss' import { FullTopic } from '../Topic/Full' import { t } from '../../utils/intl' import { params } from '../../stores/router' import { useTopicsStore } from '../../stores/zine/topics' import { useArticlesStore } from '../../stores/zine/articles' import { useStore } from '@nanostores/solid' interface TopicProps { topic: Topic topicArticles: Shout[] } export const TopicPage = (props: TopicProps) => { const args = useStore(params) const { getAuthorsByTopic } = useTopicsStore({ topics: [props.topic] }) const { getSortedArticles: sortedArticles } = useArticlesStore({ sortedArticles: props.topicArticles }) const topic = createMemo(() => props.topic) /* const slug = createMemo(() => { let slug = props?.slug if (props?.slug.startsWith('@')) slug = slug.replace('@', '') return slug }) */ const title = createMemo(() => { // const m = by() // if (m === 'viewed') return t('Top viewed') // if (m === 'rating') return t('Top rated') // if (m === 'commented') return t('Top discussed') return t('Top recent') }) return (
{`${t('Show')} `} {t('All posts')}

{title()}

{(a: Shout) => (
)}
5}>
) }