mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-02-24 19:44:53 +01:00
16 lines
395 B
TypeScript
16 lines
395 B
TypeScript
import { convertFileSrc } from '@tauri-apps/api/tauri';
|
|
import type { HttpResponse } from '../../lib/models';
|
|
|
|
interface Props {
|
|
response: HttpResponse;
|
|
}
|
|
|
|
export function ImageViewer({ response }: Props) {
|
|
if (response.bodyPath === null) {
|
|
return <div>Empty response body</div>;
|
|
}
|
|
|
|
const src = convertFileSrc(response.bodyPath);
|
|
return <img src={src} alt="Response preview" />;
|
|
}
|