webapp/src/components/Author/AhtorLink/AuthorLink.tsx

29 lines
756 B
TypeScript
Raw Normal View History

import { clsx } from 'clsx'
import { Author } from '../../../graphql/types.gen'
import { Userpic } from '../Userpic'
import styles from './AhtorLink.module.scss'
type Props = {
author: Author
size?: 'XS' | 'M' | 'L'
class?: string
2023-11-20 21:31:52 +00:00
isFloorImportant?: boolean
}
export const AuthorLink = (props: Props) => {
return (
2023-11-20 21:31:52 +00:00
<div
class={clsx(styles.AuthorLink, props.class, styles[props.size ?? 'M'], {
[styles.authorLinkFloorImportant]: props.isFloorImportant,
})}
>
<a class={styles.link} href={`/author/${props.author.slug}`}>
<Userpic size={props.size ?? 'M'} name={props.author.name} userpic={props.author.userpic} />
<div class={styles.name}>{props.author.name}</div>
</a>
</div>
)
}