2023-03-03 18:26:26 +00:00
|
|
|
import { clsx } from 'clsx'
|
|
|
|
import { getPagePath } from '@nanostores/router'
|
|
|
|
import { router } from '../../stores/router'
|
|
|
|
import styles from './CardTopic.module.scss'
|
2022-10-19 14:26:49 +00:00
|
|
|
|
2023-03-03 18:26:26 +00:00
|
|
|
type CardTopicProps = {
|
2022-10-19 14:26:49 +00:00
|
|
|
title: string
|
|
|
|
slug: string
|
|
|
|
isFloorImportant?: boolean
|
2023-06-21 20:32:16 +00:00
|
|
|
isFeedMode?: boolean
|
2023-05-29 20:46:30 +00:00
|
|
|
class?: string
|
2022-10-19 14:26:49 +00:00
|
|
|
}
|
|
|
|
|
2022-12-01 18:45:35 +00:00
|
|
|
export const CardTopic = (props: CardTopicProps) => {
|
2022-10-19 14:26:49 +00:00
|
|
|
return (
|
|
|
|
<div
|
2023-05-29 20:46:30 +00:00
|
|
|
class={clsx(styles.shoutTopic, props.class, {
|
2023-06-21 20:32:16 +00:00
|
|
|
[styles.shoutTopicFloorImportant]: props.isFloorImportant,
|
|
|
|
[styles.shoutTopicFeedMode]: props.isFeedMode
|
2023-03-03 18:26:26 +00:00
|
|
|
})}
|
2022-10-19 14:26:49 +00:00
|
|
|
>
|
2023-03-03 18:26:26 +00:00
|
|
|
<a href={getPagePath(router, 'topic', { slug: props.slug })}>{props.title}</a>
|
2022-10-19 14:26:49 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|