mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 23:59:08 +00:00
Some checks failed
🤖 Android APK Build / 🏗️ Build Android APK (push) Has been cancelled
🤖 iOS IPA Build / 🏗️ Build iOS IPA (push) Has been cancelled
🔒 Lockfile Consistency Check / 🔍 Check bun.lock and package.json consistency (push) Has been cancelled
🛡️ CodeQL Analysis / 🔎 Analyze with CodeQL (javascript-typescript) (push) Has been cancelled
🏷️🔀Merge Conflict Labeler / 🏷️ Labeling Merge Conflicts (push) Has been cancelled
🕒 Handle Stale Issues / 🗑️ Cleanup Stale Issues (push) Has been cancelled
25 lines
697 B
TypeScript
25 lines
697 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"}
|
|
fillColor={isFavorite ? "primary" : undefined}
|
|
onPress={toggleFavorite}
|
|
/>
|
|
</View>
|
|
);
|
|
};
|