import { Show, createMemo } from 'solid-js' import type { Author, Shout } from '../../graphql/types.gen' import Row2 from '../Feed/Row2' import Row3 from '../Feed/Row3' import Beside from '../Feed/Beside' import AuthorFull from '../Author/Full' import { t } from '../../utils/intl' import { useAuthorsStore } from '../../stores/zine/authors' import { params } from '../../stores/router' import { useArticlesStore } from '../../stores/zine/articles' import '../../styles/Topic.scss' import { useStore } from '@nanostores/solid' import { useTopicsStore } from '../../stores/zine/topics' type AuthorProps = { authorArticles: Shout[] author: Author } export const AuthorPage = (props: AuthorProps) => { const { getSortedArticles: articles, getArticlesByAuthor } = useArticlesStore({ sortedArticles: props.authorArticles }) const { getAuthorEntities: authors } = useAuthorsStore({ authors: [props.author] }) const { getTopicsByAuthor } = useTopicsStore() const author = createMemo(() => authors()[props.author.slug]) const args = useStore(params) //const slug = createMemo(() => author().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('Loading')}
}>
{`${t('Show')} `} {t('All posts')}

{title()}

0}>
) }