import clsx from 'clsx' import { User } from '../../../common/user' import { Row } from '../layout/row' import { CATEGORIES, CATEGORY_LIST } from '../../../common/categories' export function CategorySelector(props: { user: User | null | undefined category: string setCategory: (category: string) => void className?: string }) { const { className, user, category, setCategory } = props return (
{ if (!user?.id) return setCategory('all') }} /> {CATEGORY_LIST.map((cat) => ( { if (!user?.id) return setCategory(cat) }} /> ))} ) } function CategoryButton(props: { category: string isFollowed: boolean toggle: () => void }) { const { toggle, category, isFollowed } = props return (
{category}
) }