Files
yaak-mountain-loop/src-web/components/responseViewers/VideoViewer.tsx
2024-09-22 21:27:10 -07:00

19 lines
500 B
TypeScript

import { convertFileSrc } from '@tauri-apps/api/core';
import React from 'react';
import type { HttpResponse } from '@yaakapp-internal/models';
interface Props {
response: HttpResponse;
}
export function VideoViewer({ response }: Props) {
if (response.bodyPath === null) {
return <div>Empty response body</div>;
}
const src = convertFileSrc(response.bodyPath);
// eslint-disable-next-line jsx-a11y/media-has-caption
return <video className="w-full" controls src={src}></video>;
}