mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-01-15 23:59:08 +00:00
39 lines
1008 B
TypeScript
39 lines
1008 B
TypeScript
import type { BaseItemDto } from "@jellyfin/sdk/lib/generated-client";
|
|
import type { FC } from "react";
|
|
import { Platform, View, type ViewProps } from "react-native";
|
|
import { RoundButton } from "@/components/RoundButton";
|
|
import { useRefreshMetadata } from "@/hooks/useRefreshMetadata";
|
|
|
|
interface Props extends ViewProps {
|
|
item: BaseItemDto;
|
|
}
|
|
|
|
export const RefreshMetadata: FC<Props> = ({ item, ...props }) => {
|
|
const { refreshMetadata, isRefreshing } = useRefreshMetadata(item);
|
|
|
|
if (Platform.OS === "ios") {
|
|
return (
|
|
<View {...props}>
|
|
<RoundButton
|
|
size='large'
|
|
icon='reload-outline'
|
|
onPress={refreshMetadata}
|
|
hapticFeedback={!isRefreshing}
|
|
/>
|
|
</View>
|
|
);
|
|
}
|
|
|
|
return (
|
|
<View {...props}>
|
|
<RoundButton
|
|
size='large'
|
|
icon='reload-outline'
|
|
onPress={refreshMetadata}
|
|
hapticFeedback={!isRefreshing}
|
|
fillColor={isRefreshing ? "primary" : undefined}
|
|
/>
|
|
</View>
|
|
);
|
|
};
|