mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-21 00:49:17 +01:00
Migrate to Vite+ unified toolchain (#428)
This commit is contained in:
@@ -22,6 +22,6 @@ export function AudioViewer({ bodyPath, data }: Props) {
|
||||
}
|
||||
}, [bodyPath, data]);
|
||||
|
||||
// biome-ignore lint/a11y/useMediaCaption: none
|
||||
// oxlint-disable-next-line jsx-a11y/media-has-caption
|
||||
return <audio className="w-full" controls src={src} />;
|
||||
}
|
||||
|
||||
@@ -36,7 +36,7 @@ export function CsvViewerInner({ text, className }: { text: string | null; class
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
{parsed.data.map((row, i) => (
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: none
|
||||
// oxlint-disable-next-line react/no-array-index-key
|
||||
<TableRow key={i}>
|
||||
{parsed.meta.fields?.map((key) => (
|
||||
<TableCell key={key}>{row[key] ?? ''}</TableCell>
|
||||
|
||||
@@ -75,7 +75,7 @@ export function MultipartViewer({ data, boundary, idPrefix = 'multipart' }: Prop
|
||||
>
|
||||
{parts.map((part, i) => (
|
||||
<TabContent
|
||||
// biome-ignore lint/suspicious/noArrayIndexKey: Nothing else to key on
|
||||
// oxlint-disable-next-line react/no-array-index-key -- Nothing else to key on
|
||||
key={idPrefix + part.name + i}
|
||||
value={tabValue(part, i)}
|
||||
className="pl-3 !pt-0"
|
||||
|
||||
@@ -6,13 +6,14 @@ import type { PDFDocumentProxy } from 'pdfjs-dist';
|
||||
import { useEffect, useRef, useState } from 'react';
|
||||
import { Document, Page } from 'react-pdf';
|
||||
import { useContainerSize } from '../../hooks/useContainerQuery';
|
||||
import { fireAndForget } from '../../lib/fireAndForget';
|
||||
|
||||
import('react-pdf').then(({ pdfjs }) => {
|
||||
fireAndForget(import('react-pdf').then(({ pdfjs }) => {
|
||||
pdfjs.GlobalWorkerOptions.workerSrc = new URL(
|
||||
'pdfjs-dist/build/pdf.worker.min.mjs',
|
||||
import.meta.url,
|
||||
).toString();
|
||||
});
|
||||
}));
|
||||
|
||||
interface Props {
|
||||
bodyPath?: string;
|
||||
@@ -56,7 +57,7 @@ export function PdfViewer({ bodyPath, data }: Props) {
|
||||
externalLinkTarget="_blank"
|
||||
externalLinkRel="noopener noreferrer"
|
||||
>
|
||||
{Array.from(new Array(numPages), (_, index) => (
|
||||
{Array.from({ length: numPages ?? 0 }, (_, index) => (
|
||||
<Page
|
||||
className="mb-6 select-all"
|
||||
renderTextLayer
|
||||
|
||||
@@ -22,6 +22,6 @@ export function VideoViewer({ bodyPath, data }: Props) {
|
||||
}
|
||||
}, [bodyPath, data]);
|
||||
|
||||
// biome-ignore lint/a11y/useMediaCaption: none
|
||||
// oxlint-disable-next-line jsx-a11y/media-has-caption
|
||||
return <video className="w-full" controls src={src} />;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user