import { createEffect, For, Show } from 'solid-js' import type { Topic } from '../../graphql/types.gen' import { Icon } from '../Nav/Icon' import { t } from '../../utils/intl' import { setSortAllBy as setSortAllTopicsBy, useTopicsStore } from '../../stores/zine/topics' import { handleClientRouteLinkClick, useRouter } from '../../stores/router' import { TopicCard } from '../Topic/Card' import { session } from '../../stores/auth' import { useStore } from '@nanostores/solid' import '../../styles/AllTopics.scss' type AllTopicsPageSearchParams = { by: 'shouts' | 'authors' | 'title' | '' } type Props = { topics: Topic[] } export const AllTopicsView = (props: Props) => { const { getSearchParams, changeSearchParam } = useRouter() const { sortedTopics } = useTopicsStore({ topics: props.topics, sortBy: getSearchParams().by || 'shouts' }) const auth = useStore(session) createEffect(() => { setSortAllTopicsBy(getSearchParams().by || 'shouts') }) const subscribed = (s) => Boolean(auth()?.info?.topics && auth()?.info?.topics?.includes(s || '')) return (
0}>
{(topic) => ( )}
{/*FIXME*/} {/* (*/} {/*
*/} {/* */} {/* {(topic: Topic) => (*/} {/* */} {/* )}*/} {/* */} {/*
*/} {/* )}*/} {/*>*/} {/* */} {/* {(letter: string) => (*/} {/*
*/} {/*

{letter}

*/} {/*
*/} {/*
*/} {/* */} {/* {(topic: Partial) => (*/} {/*
*/} {/*
*/} {/* {topic.title}*/} {/*
*/} {/*
*/} {/* )}*/} {/*
*/} {/*
*/} {/*
*/} {/*
*/} {/* )}*/} {/*
*/} {/**/}
) }