diff --git a/src/components/Author/AuthorRatingControl.tsx b/src/components/Author/AuthorRatingControl.tsx
index 31af321a..0e1902f4 100644
--- a/src/components/Author/AuthorRatingControl.tsx
+++ b/src/components/Author/AuthorRatingControl.tsx
@@ -3,6 +3,9 @@ import type { Author } from '../../graphql/schema/core.gen'
import { clsx } from 'clsx'
import styles from './AuthorRatingControl.module.scss'
+import { Show, createSignal } from 'solid-js'
+import { useLocalize } from '../../context/localize'
+import { apiClient } from '../../graphql/client/core'
interface AuthorRatingControlProps {
author: Author
@@ -12,12 +15,14 @@ interface AuthorRatingControlProps {
export const AuthorRatingControl = (props: AuthorRatingControlProps) => {
const isUpvoted = false
const isDownvoted = false
-
+ const { t } = useLocalize()
// eslint-disable-next-line unicorn/consistent-function-scoping
- const handleRatingChange = (isUpvote: boolean) => {
+ const handleRatingChange = async (isUpvote: boolean) => {
console.log('handleRatingChange', { isUpvote })
+ await apiClient.rateAuthor({ rated_slug: props.author.slug, value: isUpvote ? 1 : -1 })
}
+ const [rating, setRating] = createSignal(props.author.stat.rating)
return (
{
−
{/*TODO*/}
-
{123}
+
+
{rating()}
+
+ {props.author?.stat?.rating_shouts}
+
+
+ {props.author?.stat?.rating_comments}
+
+