mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-03-04 00:36:18 +00:00
34 lines
812 B
TypeScript
34 lines
812 B
TypeScript
import { Ionicons } from "@expo/vector-icons";
|
|
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
|
import React from "react";
|
|
import { useMarkAsPlayed } from "@/hooks/useMarkAsPlayed";
|
|
import { TVButton } from "./TVButton";
|
|
|
|
export interface TVPlayedButtonProps {
|
|
item: BaseItemDto;
|
|
disabled?: boolean;
|
|
}
|
|
|
|
export const TVPlayedButton: React.FC<TVPlayedButtonProps> = ({
|
|
item,
|
|
disabled,
|
|
}) => {
|
|
const isPlayed = item.UserData?.Played ?? false;
|
|
const toggle = useMarkAsPlayed([item]);
|
|
|
|
return (
|
|
<TVButton
|
|
onPress={() => toggle(!isPlayed)}
|
|
variant='glass'
|
|
square
|
|
disabled={disabled}
|
|
>
|
|
<Ionicons
|
|
name={isPlayed ? "checkmark-circle" : "checkmark-circle-outline"}
|
|
size={28}
|
|
color='#FFFFFF'
|
|
/>
|
|
</TVButton>
|
|
);
|
|
};
|