fix: refactor

This commit is contained in:
Fredrik Burmester
2024-08-13 20:25:30 +02:00
parent 5289c0519f
commit 855e00a676
10 changed files with 143 additions and 69 deletions

View File

@@ -1,21 +1,19 @@
import { useState } from "react";
import { Button } from "./Button";
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models";
import { currentlyPlayingItemAtom } from "./CurrentlyPlayingBar";
import { useAtom } from "jotai";
import { Feather, Ionicons } from "@expo/vector-icons";
import { runtimeTicksToMinutes } from "@/utils/time";
type Props = {
interface Props extends React.ComponentProps<typeof Button> {
item: BaseItemDto;
onPress: () => void;
chromecastReady: boolean;
};
}
export const PlayButton: React.FC<Props> = ({
item,
onPress,
chromecastReady,
...props
}) => {
return (
<Button
@@ -27,6 +25,7 @@ export const PlayButton: React.FC<Props> = ({
<Ionicons name="play-circle" size={24} color="white" />
)
}
{...props}
>
{runtimeTicksToMinutes(item?.RunTimeTicks)}
</Button>