import { useState } from 'react' import { useMutation, useQueryClient } from '@tanstack/react-query' import type { FeedVideoDto } from '../api/client' import { recheckLocal } from '../api/client' interface Props { video: FeedVideoDto } function Player({ video }: Props) { const [localFailed, setLocalFailed] = useState(false) const queryClient = useQueryClient() const recheckMutation = useMutation({ mutationFn: () => recheckLocal(video.youtube_video_id), onSettled: () => { queryClient.invalidateQueries({ queryKey: ['video', video.youtube_video_id] }) queryClient.invalidateQueries({ queryKey: ['download-status', video.youtube_video_id] }) }, }) const useLocal = video.local.available && !!video.local.media_url && !localFailed if (useLocal) { return ( <>
{/* eslint-disable-next-line jsx-a11y/media-has-caption */}
● Локальная копия · mediaVM
) } return ( <>