2023-10-20 16:21:40 +00:00
|
|
|
import { clsx } from 'clsx'
|
2023-11-14 15:10:00 +00:00
|
|
|
|
2023-10-20 16:21:40 +00:00
|
|
|
import { Author } from '../../../graphql/types.gen'
|
|
|
|
import { Userpic } from '../Userpic'
|
|
|
|
|
2023-11-14 15:10:00 +00:00
|
|
|
import styles from './AhtorLink.module.scss'
|
|
|
|
|
2023-10-20 16:21:40 +00:00
|
|
|
type Props = {
|
|
|
|
author: Author
|
|
|
|
size?: 'XS' | 'M' | 'L'
|
|
|
|
class?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export const AuthorLink = (props: Props) => {
|
|
|
|
return (
|
|
|
|
<div class={clsx(styles.AuthorLink, props.class, styles[props.size ?? 'M'])}>
|
|
|
|
<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>
|
|
|
|
)
|
|
|
|
}
|