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 { useAuthorsStore } from '../../stores/zine/authors' import { useStore } from '@nanostores/solid' interface TopicProps { topic: Topic topicArticles: Shout[] } export const TopicPage = (props: TopicProps) => { const args = useStore(params) const { getSortedArticles: sortedArticles } = useArticlesStore({ sortedArticles: props.topicArticles }) const { getTopicEntities } = useTopicsStore({ topics: [props.topic] }) const { getAuthorsByTopic } = useAuthorsStore() const topic = createMemo(() => getTopicEntities()[props.topic.slug]) /* const slug = createMemo(() => { let slug = props?.slug if (props?.slug.startsWith('@')) slug = slug.replace('@', '') return slug }) */ const title = createMemo(() => { const m = args()['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()}

{(article) => (
)}
5}>
) }