mirror of
https://github.com/streamyfin/streamyfin.git
synced 2025-08-20 18:37:18 +02:00
25 lines
637 B
TypeScript
25 lines
637 B
TypeScript
|
|
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
|
import { useFavorite } from "@/hooks/useFavorite";
|
|
import { View } from "react-native";
|
|
import { RoundButton } from "@/components/RoundButton";
|
|
|
|
interface Props extends ViewProps {
|
|
item: BaseItemDto;
|
|
}
|
|
|
|
export const AddToFavorites = ({ item, ...props }) => {
|
|
const { isFavorite, toggleFavorite, _} = useFavorite(item);
|
|
|
|
return (
|
|
<View {...props}>
|
|
<RoundButton
|
|
size="large"
|
|
icon={isFavorite ? "heart" : "heart-outline"}
|
|
fillColor={isFavorite ? "primary" : undefined}
|
|
onPress={toggleFavorite}
|
|
/>
|
|
</View>
|
|
);
|
|
};
|