2022-11-23 19:14:59 +00:00
|
|
|
import styles from './RatingControl.module.scss'
|
|
|
|
import { clsx } from 'clsx'
|
2022-11-27 06:33:05 +00:00
|
|
|
import { Icon } from '../_shared/Icon'
|
2022-11-23 19:14:59 +00:00
|
|
|
|
|
|
|
interface RatingControlProps {
|
|
|
|
rating?: number
|
|
|
|
class?: string
|
|
|
|
}
|
|
|
|
|
|
|
|
export const RatingControl = (props: RatingControlProps) => {
|
|
|
|
return (
|
|
|
|
<div class={clsx(props.class, styles.rating)}>
|
2022-11-27 06:33:05 +00:00
|
|
|
<button class={styles.ratingControl}>
|
|
|
|
<Icon name="dislike" />
|
|
|
|
</button>
|
2022-11-23 19:14:59 +00:00
|
|
|
<span class={styles.ratingValue}>{props?.rating || ''}</span>
|
2022-11-27 06:33:05 +00:00
|
|
|
<button class={styles.ratingControl}>
|
|
|
|
<Icon name="like" />
|
|
|
|
</button>
|
2022-11-23 19:14:59 +00:00
|
|
|
</div>
|
|
|
|
)
|
|
|
|
}
|