mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-02-14 00:02:24 +00:00
24 lines
662 B
TypeScript
24 lines
662 B
TypeScript
import { Ionicons } from "@expo/vector-icons";
|
|
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
|
import React from "react";
|
|
import { useFavorite } from "@/hooks/useFavorite";
|
|
import { TVButton } from "./TVButton";
|
|
|
|
export interface TVFavoriteButtonProps {
|
|
item: BaseItemDto;
|
|
}
|
|
|
|
export const TVFavoriteButton: React.FC<TVFavoriteButtonProps> = ({ item }) => {
|
|
const { isFavorite, toggleFavorite } = useFavorite(item);
|
|
|
|
return (
|
|
<TVButton onPress={toggleFavorite} variant='glass' square>
|
|
<Ionicons
|
|
name={isFavorite ? "heart" : "heart-outline"}
|
|
size={28}
|
|
color='#FFFFFF'
|
|
/>
|
|
</TVButton>
|
|
);
|
|
};
|