import { For, Show } from 'solid-js/web' import type { Author } from '../../graphql/types.gen' import Userpic from './Userpic' import { Icon } from '../Nav/Icon' import './Card.scss' import { createMemo } from 'solid-js' import { translit } from '../../utils/ru2en' import { t } from '../../utils/intl' import { useAuthStore } from '../../stores/auth' import { locale } from '../../stores/ui' import { follow, unfollow } from '../../stores/zine/common' interface AuthorCardProps { compact?: boolean hideDescription?: boolean hideFollow?: boolean hasLink?: boolean subscribed?: boolean author: Author } export const AuthorCard = (props: AuthorCardProps) => { const { session } = useAuthStore() const subscribed = createMemo( () => session()?.news?.authors?.some((u) => u === props.author.slug) || false ) const canFollow = createMemo(() => !props.hideFollow && session()?.user?.slug !== props.author.slug) const bio = () => props.author.bio || t('Our regular contributor') const name = () => { return props.author.name === 'Дискурс' && locale() !== 'ru' ? 'Discours' : translit(props.author.name || '', locale() || 'ru') } // TODO: reimplement AuthorCard return (
{name()}
{name()}
{bio()}
) }