mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-16 08:08:18 +00:00
Signed-off-by: Lance Chant <13349722+lancechant@users.noreply.github.com> Co-authored-by: sarendsen <coding-mosses0z@icloud.com> Co-authored-by: Lance Chant <13349722+lancechant@users.noreply.github.com> Co-authored-by: Gauvain <68083474+Gauvino@users.noreply.github.com>
24 lines
642 B
TypeScript
24 lines
642 B
TypeScript
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
|
import type { FC } from "react";
|
|
import { View, type ViewProps } from "react-native";
|
|
import { RoundButton } from "@/components/RoundButton";
|
|
import { useFavorite } from "@/hooks/useFavorite";
|
|
|
|
interface Props extends ViewProps {
|
|
item: BaseItemDto;
|
|
}
|
|
|
|
export const AddToFavorites: FC<Props> = ({ item, ...props }) => {
|
|
const { isFavorite, toggleFavorite } = useFavorite(item);
|
|
|
|
return (
|
|
<View {...props}>
|
|
<RoundButton
|
|
size='large'
|
|
icon={isFavorite ? "heart" : "heart-outline"}
|
|
onPress={toggleFavorite}
|
|
/>
|
|
</View>
|
|
);
|
|
};
|