refactor(audio): extract to separate file

This commit is contained in:
Elian Doran 2026-03-11 18:51:20 +02:00
parent 3de712aca4
commit 23890e64e9
No known key found for this signature in database
2 changed files with 13 additions and 12 deletions

View File

@ -1,10 +1,9 @@
import "./File.css";
import FNote from "../../entities/fnote";
import { t } from "../../services/i18n";
import { getUrlForDownload } from "../../services/open";
import Alert from "../react/Alert";
import { useNoteBlob } from "../react/hooks";
import AudioPreview from "./file/Audio";
import PdfPreview from "./file/Pdf";
import VideoPreview from "./file/Video";
import { TypeWidgetProps } from "./type_widget";
@ -43,16 +42,6 @@ function TextPreview({ content }: { content: string }) {
);
}
function AudioPreview({ note }: { note: FNote }) {
return (
<audio
class="audio-preview"
src={getUrlForDownload(`api/notes/${note.noteId}/open-partial`)}
controls
/>
);
}
function NoPreview() {
return (
<Alert className="file-preview-not-available" type="info">

View File

@ -0,0 +1,12 @@
import FNote from "../../../entities/fnote";
import { getUrlForDownload } from "../../../services/open";
export default function AudioPreview({ note }: { note: FNote }) {
return (
<audio
class="audio-preview"
src={getUrlForDownload(`api/notes/${note.noteId}/open-partial`)}
controls
/>
);
}