detail: add tooltips for rating like and rating love

This commit is contained in:
FrigoDev 2026-04-24 16:59:43 -05:00
parent fc7dc45a54
commit e136770d7e

View file

@ -1,6 +1,7 @@
// Copyright (C) 2017-2025 Smart code 203358507 // Copyright (C) 2017-2025 Smart code 203358507
import React, { useMemo } from 'react'; import React, { useMemo } from 'react';
import { useTranslation } from 'react-i18next';
import useRating from './useRating'; import useRating from './useRating';
import { ActionsGroup } from 'stremio/components'; import { ActionsGroup } from 'stremio/components';
@ -11,17 +12,20 @@ type Props = {
}; };
const Ratings = ({ ratingInfo, className }: Props) => { const Ratings = ({ ratingInfo, className }: Props) => {
const { t } = useTranslation();
const { onLiked, onLoved, liked, loved } = useRating(ratingInfo); const { onLiked, onLoved, liked, loved } = useRating(ratingInfo);
const disabled = useMemo(() => ratingInfo?.type !== 'Ready', [ratingInfo]); const disabled = useMemo(() => ratingInfo?.type !== 'Ready', [ratingInfo]);
const items = useMemo(() => [ const items = useMemo(() => [
{ {
icon: liked ? 'thumbs-up' : 'thumbs-up-outline', icon: liked ? 'thumbs-up' : 'thumbs-up-outline',
label: liked ? t('RATING_UNLIKE') : t('RATING_LIKE'),
disabled, disabled,
onClick: onLiked, onClick: onLiked,
}, },
{ {
icon: loved ? 'heart' : 'heart-outline', icon: loved ? 'heart' : 'heart-outline',
label: loved ? t('RATING_UNLOVE') : t('RATING_LOVE'),
disabled, disabled,
onClick: onLoved, onClick: onLoved,
}, },