π₯ Make videos programmatically with React
linting
Jonny Burger6b054d986ab3
diff --git a/packages/eslint-config-internal/src/base.ts b/packages/eslint-config-internal/src/base.tsindex e595b3adf0..1072c22143 100644--- a/packages/eslint-config-internal/src/base.ts+++ b/packages/eslint-config-internal/src/base.ts@@ -485,15 +485,7 @@ export const rules = ({react}: {react: boolean}) => {'react/no-unused-prop-types': react ? 'off' : undefined,'react/button-has-type': react ? 'error' : undefined,'react/default-props-match-prop-types': react ? 'error' : undefined,- 'react/function-component-definition': react- ? [- 'error',- {- namedComponents: 'arrow-function',- unnamedComponents: 'arrow-function',- },- ]- : undefined,+ 'react/function-component-definition': 'off','react/jsx-child-element-spacing': 'off','react/jsx-closing-bracket-location': 'off','react/jsx-closing-tag-location': 'off',diff --git a/packages/transitions/src/TransitionSeries.tsx b/packages/transitions/src/TransitionSeries.tsxindex 4b15bb5d74..df270fdb65 100644--- a/packages/transitions/src/TransitionSeries.tsx+++ b/packages/transitions/src/TransitionSeries.tsx@@ -16,7 +16,6 @@ import {slide} from './presentations/slide.js';import type {TransitionSeriesTransitionProps} from './types.js';import {validateDurationInFrames} from './validate.js';-// eslint-disable-next-line react/function-component-definitionconst TransitionSeriesTransition = function <PresentationProps extends Record<string, unknown>,>(diff --git a/packages/whisper-web-example/package.json b/packages/whisper-web-example/package.jsonindex 458bb49dea..d7ab9e8500 100644--- a/packages/whisper-web-example/package.json+++ b/packages/whisper-web-example/package.json@@ -16,6 +16,7 @@"react-dom": "19.0.0"},"devDependencies": {+ "@remotion/eslint-config-internal": "workspace:*","@types/react": "19.0.0","@types/react-dom": "19.0.0","@vitejs/plugin-react": "4.1.0",diff --git a/packages/whisper-web-example/src/App.tsx b/packages/whisper-web-example/src/App.tsxindex f4e2b6b9d4..7c13ac9f4d 100644--- a/packages/whisper-web-example/src/App.tsx+++ b/packages/whisper-web-example/src/App.tsx@@ -1,45 +1,62 @@--import { useState } from 'react';-import './App.css'+import type {TranscriptionJson} from '@remotion/whisper-web';+import {useState} from 'react';+import './App.css';+import MainTitle from './MainTitle';import Display from './display';import DownloadModel from './downloadModel';-import TranscribeAudio from './transcribeAudio';-import MainTitle from './MainTitle';import Info from './info';-import type { TranscriptionJson } from '@remotion/whisper-web';--function VBarrier() {- return (- <div style={{- height: 50,- borderLeft: '1px solid grey'- }}></div>- )-}--function App() {- const [transcriptionCompleted, setTranscriptionCompleted] = useState(false);- const [modelDownloading, setModelDownloading] = useState(false);- const [result, setResult] = useState<TranscriptionJson | null>(null)- const [file, setFile] = useState<File | null>(null);+import TranscribeAudio from './transcribeAudio';- return (+const VBarrier = () => {+ return (+ <div+ style={{+ height: 50,+ borderLeft: '1px solid grey',+ }}+ />+ );+};- <>- <MainTitle />- <div style={{ padding: 15, left: 20, borderRadius: 15, position: 'absolute', display: 'flex', gap: 30, alignItems: 'center', top: 20, background: '#18191a' }}>- <Info />- <VBarrier />- <DownloadModel setDownloadingModel={setModelDownloading} />- <VBarrier />- <TranscribeAudio {...{ setFile, setResult, modelDownloading, file, setTranscriptionCompleted }} />- </div>- {- transcriptionCompleted && (<Display audio={file} result={result} />)- }- </>+const App = () => {+ const [transcriptionCompleted, setTranscriptionCompleted] = useState(false);+ const [modelDownloading, setModelDownloading] = useState(false);+ const [result, setResult] = useState<TranscriptionJson | null>(null);+ const [file, setFile] = useState<File | null>(null);- )-}+ return (+ <>+ <MainTitle />+ <div+ style={{+ padding: 15,+ left: 20,+ borderRadius: 15,+ position: 'absolute',+ display: 'flex',+ gap: 30,+ alignItems: 'center',+ top: 20,+ background: '#18191a',+ }}+ >+ <Info />+ <VBarrier />+ <DownloadModel setDownloadingModel={setModelDownloading} />+ <VBarrier />+ <TranscribeAudio+ {...{+ setFile,+ setResult,+ modelDownloading,+ file,+ setTranscriptionCompleted,+ }}+ />+ </div>+ {transcriptionCompleted && <Display audio={file} result={result} />}+ </>+ );+};-export default App+export default App;diff --git a/packages/whisper-web-example/src/MainTitle.tsx b/packages/whisper-web-example/src/MainTitle.tsxindex 5e9f515801..28f07f8362 100644--- a/packages/whisper-web-example/src/MainTitle.tsx+++ b/packages/whisper-web-example/src/MainTitle.tsx@@ -1,18 +1,27 @@-export default function MainTitle(){- return (- <div style={{- position: "absolute",- left: '50%',- top: '50%',- zIndex: '-1',- transform: 'translate(-50%, -50%)'- }}>- <img src="./logo-dark.png" style={{- maxWidth: 200- }}></img>- <h1 style={{- margin: 0- }}>Whisper Web</h1>- </div>- )-}\ No newline at end of file+export default function MainTitle() {+ return (+ <div+ style={{+ position: 'absolute',+ left: '50%',+ top: '50%',+ zIndex: '-1',+ transform: 'translate(-50%, -50%)',+ }}+ >+ <img+ src="./logo-dark.png"+ style={{+ maxWidth: 200,+ }}+ />+ <h1+ style={{+ margin: 0,+ }}+ >+ Whisper Web+ </h1>+ </div>+ );+}diff --git a/packages/whisper-web-example/src/display.tsx b/packages/whisper-web-example/src/display.tsxindex ab0c6d404f..10cdae6ab6 100644--- a/packages/whisper-web-example/src/display.tsx+++ b/packages/whisper-web-example/src/display.tsx@@ -1,45 +1,82 @@-import type { TranscriptionItemWithTimestamp, TranscriptionJson } from "@remotion/whisper-web";-import { useEffect, useMemo, useRef, useState } from "react"+import type {+ TranscriptionItemWithTimestamp,+ TranscriptionJson,+} from '@remotion/whisper-web';+import {useEffect, useMemo, useRef, useState} from 'react';-export default function Display({result, audio}: {result: TranscriptionJson | null, audio: File | null}){- const audioRef = useRef<HTMLAudioElement | null>(null);- const [transcriptionTextIndex, setTranscriptionTextIndex] = useState(0);- const audioUrl = useMemo(() => audio ? URL.createObjectURL(audio) : undefined, [audio]);+export default function Display({+ result,+ audio,+}: {+ readonly result: TranscriptionJson | null;+ readonly audio: File | null;+}) {+ const audioRef = useRef<HTMLAudioElement | null>(null);+ const [transcriptionTextIndex, setTranscriptionTextIndex] = useState(0);+ const audioUrl = useMemo(+ () => (audio ? URL.createObjectURL(audio) : undefined),+ [audio],+ );- useEffect(() => {- if(!audioRef.current){- return- }- audioRef.current.ontimeupdate = () => {- if (!audioRef.current) return;- const activeTime = audioRef.current.currentTime * 1000;- let timedTranscriptionIndex = -1;- if (result && result.transcription) {- timedTranscriptionIndex = result.transcription.findIndex((v: TranscriptionItemWithTimestamp) => (v.offsets.from <= activeTime && v.offsets.to >= activeTime));- }- if(timedTranscriptionIndex >= 0){- setTranscriptionTextIndex(timedTranscriptionIndex);- }- }- }, [- audioRef,- result- ])-- if(!result){- return("")- }-return (-<div style={{borderRadius: 20, padding:20, paddingRight: 40, paddingLeft: 40, justifyContent: 'center', justifyItems: 'center', gap: 20, alignItems: 'center', gridAutoFlow: 'row', display: 'grid', background: 'rgb(20, 20, 20, 0.8)', backdropFilter: 'blur(20px)', width: 'fit-content'}}>- <h2>Transcription</h2>-<audio controls ref={audioRef} autoPlay src={audioUrl}></audio>-<p >- <span style={{ opacity: 1, fontWeight: 900}}>- {result.transcription.slice(0, transcriptionTextIndex + 1).map(({text}) => text)}- </span>- <span style={{opacity: 0.5, fontWeight: 900}}>{- result.transcription.slice(transcriptionTextIndex + 1).map(({text}) => text).join(" ")- }</span>-</p>-</div>)-}\ No newline at end of file+ useEffect(() => {+ if (!audioRef.current) {+ return;+ }++ audioRef.current.ontimeupdate = () => {+ if (!audioRef.current) return;+ const activeTime = audioRef.current.currentTime * 1000;+ let timedTranscriptionIndex = -1;+ if (result && result.transcription) {+ timedTranscriptionIndex = result.transcription.findIndex(+ (v: TranscriptionItemWithTimestamp) =>+ v.offsets.from <= activeTime && v.offsets.to >= activeTime,+ );+ }++ if (timedTranscriptionIndex >= 0) {+ setTranscriptionTextIndex(timedTranscriptionIndex);+ }+ };+ }, [audioRef, result]);++ if (!result) {+ return '';+ }++ return (+ <div+ style={{+ borderRadius: 20,+ padding: 20,+ paddingRight: 40,+ paddingLeft: 40,+ justifyContent: 'center',+ justifyItems: 'center',+ gap: 20,+ alignItems: 'center',+ gridAutoFlow: 'row',+ display: 'grid',+ background: 'rgb(20, 20, 20, 0.8)',+ backdropFilter: 'blur(20px)',+ width: 'fit-content',+ }}+ >+ <h2>Transcription</h2>+ <audio ref={audioRef} controls autoPlay src={audioUrl} />+ <p>+ <span style={{opacity: 1, fontWeight: 900}}>+ {result.transcription+ .slice(0, transcriptionTextIndex + 1)+ .map(({text}) => text)}+ </span>+ <span style={{opacity: 0.5, fontWeight: 900}}>+ {result.transcription+ .slice(transcriptionTextIndex + 1)+ .map(({text}) => text)+ .join(' ')}+ </span>+ </p>+ </div>+ );+}diff --git a/packages/whisper-web-example/src/downloadModel.tsx b/packages/whisper-web-example/src/downloadModel.tsxindex 8f70d28e3d..592cc2b701 100644--- a/packages/whisper-web-example/src/downloadModel.tsx+++ b/packages/whisper-web-example/src/downloadModel.tsx@@ -1,50 +1,73 @@-import { downloadWhisperModel, type DownloadWhisperModelParams } from "@remotion/whisper-web";-import { useState } from "react";+import {+ downloadWhisperModel,+ type DownloadWhisperModelParams,+} from '@remotion/whisper-web';+import {useState} from 'react';-export default function DownloadModel({ setDownloadingModel }: { setDownloadingModel: (downloading: boolean) => void }) {- const modelOptions: DownloadWhisperModelParams["model"][] = [- "tiny.en",- "tiny",- "small",- "small.en",- "base",- "base.en",-- ];+export default function DownloadModel({+ setDownloadingModel,+}: {+ readonly setDownloadingModel: (downloading: boolean) => void;+}) {+ const modelOptions: DownloadWhisperModelParams['model'][] = [+ 'tiny.en',+ 'tiny',+ 'small',+ 'small.en',+ 'base',+ 'base.en',+ ];- const [selectedModel, setSelectedModel] = useState<DownloadWhisperModelParams["model"]>("tiny.en");- const [downloadModelProgress, setDownloadProgress] = useState<number>(0);-- return (- <div style={{- display:"flex",- gap: 20,- flexFlow: "column",- }}>- <div style={{- display: "flex",- gap: 20- }}>- <select- value={selectedModel}- onChange={e => setSelectedModel(e.target.value as DownloadWhisperModelParams["model"])}- >- {modelOptions.map((model) => (- <option key={model} value={model}>- {model}- </option>- ))}- </select>- <button style={{background: "rgb(50, 50, 50)"}} onClick={() => {+ const [selectedModel, setSelectedModel] =+ useState<DownloadWhisperModelParams['model']>('tiny.en');+ const [downloadModelProgress, setDownloadProgress] = useState<number>(0);- setDownloadingModel(true)- downloadWhisperModel({ model: selectedModel, onProgress: (v) => setDownloadProgress(v.progress) }).then(()=>setDownloadingModel(false))- }} >- download model- </button>- </div>- { (downloadModelProgress !== 0 && downloadModelProgress !== 1) && <progress value={downloadModelProgress} max={1} />}- { (downloadModelProgress == 1) && <span>done β </span> }- </div>- )-}\ No newline at end of file+ return (+ <div+ style={{+ display: 'flex',+ gap: 20,+ flexFlow: 'column',+ }}+ >+ <div+ style={{+ display: 'flex',+ gap: 20,+ }}+ >+ <select+ value={selectedModel}+ onChange={(e) =>+ setSelectedModel(+ e.target.value as DownloadWhisperModelParams['model'],+ )+ }+ >+ {modelOptions.map((model) => (+ <option key={model} value={model}>+ {model}+ </option>+ ))}+ </select>+ <button+ type="button"+ style={{background: 'rgb(50, 50, 50)'}}+ onClick={() => {+ setDownloadingModel(true);+ downloadWhisperModel({+ model: selectedModel,+ onProgress: (v) => setDownloadProgress(v.progress),+ }).then(() => setDownloadingModel(false));+ }}+ >+ download model+ </button>+ </div>+ {downloadModelProgress !== 0 && downloadModelProgress !== 1 && (+ <progress value={downloadModelProgress} max={1} />+ )}+ {downloadModelProgress === 1 && <span>done β </span>}+ </div>+ );+}diff --git a/packages/whisper-web-example/src/info.tsx b/packages/whisper-web-example/src/info.tsxindex 7357a1a17b..78cf7e84c7 100644--- a/packages/whisper-web-example/src/info.tsx+++ b/packages/whisper-web-example/src/info.tsx@@ -1,27 +1,41 @@-export default function Info(){- //returns package name with logo, and links- return (- <div style={{- display: 'flex',- flexFlow: 'column',- gap: 10- }}>- <div style={{- display: 'flex',- gap: 10,- }}>- <img src="./mainlogo.png" style={{maxWidth: 30, alignSelf:'center'}}></img>- <h2 style={{- margin:0- }}>Whisper Web</h2>- </div>- <div style={{- display: 'flex',- gap: 10- }}>- <a href="https://github.com/remotion-dev/remotion/tree/main/packages/whisper-web-example">View Source Code</a>- <a href="https://www.remotion.dev/docs/whisper-web/">Read Documentation</a>- </div>- </div>- )-}\ No newline at end of file+export default function Info() {+ // returns package name with logo, and links+ return (+ <div+ style={{+ display: 'flex',+ flexFlow: 'column',+ gap: 10,+ }}+ >+ <div+ style={{+ display: 'flex',+ gap: 10,+ }}+ >+ <img src="./mainlogo.png" style={{maxWidth: 30, alignSelf: 'center'}} />+ <h2+ style={{+ margin: 0,+ }}+ >+ Whisper Web+ </h2>+ </div>+ <div+ style={{+ display: 'flex',+ gap: 10,+ }}+ >+ <a href="https://github.com/remotion-dev/remotion/tree/main/packages/whisper-web-example">+ View Source Code+ </a>+ <a href="https://www.remotion.dev/docs/whisper-web/">+ Read Documentation+ </a>+ </div>+ </div>+ );+}diff --git a/packages/whisper-web-example/src/selectTranscriptionModel.tsx b/packages/whisper-web-example/src/selectTranscriptionModel.tsxindex 5ec6d1eae2..356129502b 100644--- a/packages/whisper-web-example/src/selectTranscriptionModel.tsx+++ b/packages/whisper-web-example/src/selectTranscriptionModel.tsx@@ -1,43 +1,65 @@-import { getLoadedModels, type DownloadWhisperModelParams } from "@remotion/whisper-web"-import { useEffect, useState } from "react"+import {+ getLoadedModels,+ type DownloadWhisperModelParams,+} from '@remotion/whisper-web';+import {useEffect, useState} from 'react';interface SelectTranscriptionModelProps {- loadingLoadedModels: boolean;- setLoadingLoadedModels: (value: boolean) => void;- setModelForTranscription: (value: DownloadWhisperModelParams["model"] | undefined) => void;- modelDownloading: boolean,- transcribing: boolean+ readonly loadingLoadedModels: boolean;+ readonly setLoadingLoadedModels: (value: boolean) => void;+ readonly setModelForTranscription: (+ value: DownloadWhisperModelParams['model'] | undefined,+ ) => void;+ readonly modelDownloading: boolean;+ readonly transcribing: boolean;}-export default function SelectTranscriptionModel({ loadingLoadedModels, modelDownloading, setLoadingLoadedModels, transcribing, setModelForTranscription }: SelectTranscriptionModelProps) {- const [modelsAvailable, setModelsAvailable] = useState<DownloadWhisperModelParams["model"][]>(["tiny.en"]);- useEffect(()=>{- if(modelDownloading){- return- }- const loader = async () => {- setLoadingLoadedModels(true);- getLoadedModels().then(data=> {- setModelsAvailable(data);- setLoadingLoadedModels(false)- if(data.length == 0){- setModelForTranscription(undefined)- }else{- setModelForTranscription(data[0])- }- })- };- loader()+export default function SelectTranscriptionModel({+ loadingLoadedModels,+ modelDownloading,+ setLoadingLoadedModels,+ transcribing,+ setModelForTranscription,+}: SelectTranscriptionModelProps) {+ const [modelsAvailable, setModelsAvailable] = useState<+ DownloadWhisperModelParams['model'][]+ >(['tiny.en']);+ useEffect(() => {+ if (modelDownloading) {+ return;+ }- // eslint-disable-next-line- }, [modelDownloading])- return (- <select onChange={(e) => setModelForTranscription(e.target.value as DownloadWhisperModelParams["model"])} disabled={loadingLoadedModels || transcribing}>- {- modelsAvailable.map(model => <option key={model} value={model}>- {model}- </option>)- }- </select>- )-}\ No newline at end of file+ const loader = () => {+ setLoadingLoadedModels(true);+ getLoadedModels().then((data) => {+ setModelsAvailable(data);+ setLoadingLoadedModels(false);+ if (data.length === 0) {+ setModelForTranscription(undefined);+ } else {+ setModelForTranscription(data[0]);+ }+ });+ };++ loader();++ // eslint-disable-next-line+ }, [modelDownloading]);+ return (+ <select+ onChange={(e) =>+ setModelForTranscription(+ e.target.value as DownloadWhisperModelParams['model'],+ )+ }+ disabled={loadingLoadedModels || transcribing}+ >+ {modelsAvailable.map((model) => (+ <option key={model} value={model}>+ {model}+ </option>+ ))}+ </select>+ );+}diff --git a/packages/whisper-web-example/src/transcribeAudio.tsx b/packages/whisper-web-example/src/transcribeAudio.tsxindex a5c2637a21..7b7f4cf09d 100644--- a/packages/whisper-web-example/src/transcribeAudio.tsx+++ b/packages/whisper-web-example/src/transcribeAudio.tsx@@ -1,102 +1,146 @@-import { resampleTo16Khz, transcribe, type DownloadWhisperModelParams, type TranscriptionJson } from "@remotion/whisper-web";-import { useEffect, useRef, useState } from "react";-import SelectTranscriptionModel from "./selectTranscriptionModel";+/* eslint-disable no-console */+import {+ resampleTo16Khz,+ transcribe,+ type DownloadWhisperModelParams,+ type TranscriptionJson,+} from '@remotion/whisper-web';+import {useEffect, useRef, useState} from 'react';+import SelectTranscriptionModel from './selectTranscriptionModel';export default function TranscribeAudio({- setResult,- setTranscriptionCompleted,- setFile,- file,- modelDownloading+ setResult,+ setTranscriptionCompleted,+ setFile,+ file,+ modelDownloading,}: {- setResult: (result: TranscriptionJson | null) => void,- setTranscriptionCompleted: (completed: boolean) => void,- setFile: (file: File) => void,- file: File | null,- modelDownloading: boolean+ readonly setResult: (result: TranscriptionJson | null) => void;+ readonly setTranscriptionCompleted: (completed: boolean) => void;+ readonly setFile: (file: File) => void;+ readonly file: File | null;+ readonly modelDownloading: boolean;}) {- const fileref = useRef<HTMLInputElement>(null)- const [waveForm, setWaveForm] = useState<Float32Array>(new Float32Array());- const [loadingLoadedModels, setLoadingLoadedModels] = useState(false);- const [modelForTranscription, setModelForTranscription] = useState<DownloadWhisperModelParams["model"] | undefined>(undefined)- const [transcribing, setTranscribing] = useState(false);- const [progress, setProgress] = useState(0);- useEffect(()=>{- }, [modelForTranscription])- useEffect(() => {- //sync the file between two input sources- if (!file || !fileref?.current) {- return;- }- if (file && fileref.current.files && fileref.current.files.length === 0) {- const dataTransfer = new DataTransfer();- dataTransfer.items.add(file);- fileref.current.files = dataTransfer.files;- }- },- [fileref, file])+ const fileref = useRef<HTMLInputElement>(null);+ const [waveForm, setWaveForm] = useState<Float32Array>(new Float32Array());+ const [loadingLoadedModels, setLoadingLoadedModels] = useState(false);+ const [modelForTranscription, setModelForTranscription] = useState<+ DownloadWhisperModelParams['model'] | undefined+ >(undefined);+ const [transcribing, setTranscribing] = useState(false);+ const [progress, setProgress] = useState(0);+ useEffect(() => {}, [modelForTranscription]);+ useEffect(() => {+ // sync the file between two input sources+ if (!file || !fileref?.current) {+ return;+ }+ if (file && fileref.current.files && fileref.current.files.length === 0) {+ const dataTransfer = new DataTransfer();+ dataTransfer.items.add(file);+ fileref.current.files = dataTransfer.files;+ }+ }, [fileref, file]);- return (- <div style={{- display: "flex",- gap: 15,- alignItems: "center"- }}>- <div style={{- display: "flex",- flexFlow: "column",- gap: 10- }}>- <input ref={fileref} type='file' onChange={(ch: React.ChangeEvent<HTMLInputElement>) => {- setResult(null);- setTranscriptionCompleted(false);- const file = ch.target?.files?.[0];- if (file) {- setFile(file);- resampleTo16Khz({ file, onProgress: (e) => console.log(e) }).then(waveform => setWaveForm(waveform))+ return (+ <div+ style={{+ display: 'flex',+ gap: 15,+ alignItems: 'center',+ }}+ >+ <div+ style={{+ display: 'flex',+ flexFlow: 'column',+ gap: 10,+ }}+ >+ <input+ ref={fileref}+ type="file"+ onChange={(ch: React.ChangeEvent<HTMLInputElement>) => {+ setResult(null);+ setTranscriptionCompleted(false);+ const _file = ch.target?.files?.[0];+ if (_file) {+ setFile(_file);+ resampleTo16Khz({+ file: _file,- }- }- } />+ onProgress: (e) => console.log(e),+ }).then((waveform) => setWaveForm(waveform));+ }+ }}+ />+ <div+ onDrop={(e) => {+ e.preventDefault();+ setResult(null);+ setTranscriptionCompleted(false);+ const _file = e.dataTransfer.files?.[0];+ if (_file) {+ setFile(_file);+ resampleTo16Khz({+ file: _file,- <div- onDrop={e => {- e.preventDefault();- setResult(null);- setTranscriptionCompleted(false);- const file = e.dataTransfer.files?.[0];- if (file) {- setFile(file);- resampleTo16Khz({ file, onProgress: (e) => console.log(e) }).then(waveform => setWaveForm(waveform));- }- }}- onDragOver={e => e.preventDefault()}- style={{ border: '2px dashed rgb(230, 230, 230, 0.5)', padding: 2, marginBottom: 8 }}- >- {file ? `Selected file: ${file.name}` : "Drop here"}- </div>+ onProgress: (err) => console.log(err),+ }).then((waveform) => setWaveForm(waveform));+ }+ }}+ onDragOver={(e) => e.preventDefault()}+ style={{+ border: '2px dashed rgb(230, 230, 230, 0.5)',+ padding: 2,+ marginBottom: 8,+ }}+ >+ {file ? `Selected file: ${file.name}` : 'Drop here'}+ </div>+ </div>+ <div style={{display: 'grid', gridAutoFlow: 'row', gap: 10}}>+ <SelectTranscriptionModel+ transcribing={transcribing}+ modelDownloading={modelDownloading}+ setModelForTranscription={setModelForTranscription}+ setLoadingLoadedModels={setLoadingLoadedModels}+ loadingLoadedModels={loadingLoadedModels}+ />- </div>- <div style={{ display: 'grid', gridAutoFlow: 'row', gap: 10 }}>- <SelectTranscriptionModel transcribing={transcribing} modelDownloading={modelDownloading} setModelForTranscription={setModelForTranscription} setLoadingLoadedModels={setLoadingLoadedModels} loadingLoadedModels={loadingLoadedModels} />-- <button disabled={modelDownloading || !modelForTranscription || transcribing || !file || loadingLoadedModels} style={{ background: '#0b84f3' }} onClick={() => {- if (!modelForTranscription) return;- setTranscribing(true);- transcribe({ channelWaveform: waveForm, model: modelForTranscription, threads: 9, onTranscriptionChunk: (e) => console.log(e), onProgress: (p) => setProgress(p) }).then(result => {- setResult(result)- setTranscribing(false);- setTranscriptionCompleted(true);- setProgress(0)- })-- }-- } >Transcribe</button>- { transcribing && <progress max={1} value={progress} />}- </div>- </div>- )-}\ No newline at end of file+ <button+ type="button"+ disabled={+ modelDownloading ||+ !modelForTranscription ||+ transcribing ||+ !file ||+ loadingLoadedModels+ }+ style={{background: '#0b84f3'}}+ onClick={() => {+ if (!modelForTranscription) return;+ setTranscribing(true);+ transcribe({+ channelWaveform: waveForm,+ model: modelForTranscription,+ threads: 9,+ onTranscriptionChunk: (e) => console.log(e),+ onProgress: (p) => setProgress(p),+ }).then((result) => {+ setResult(result);+ setTranscribing(false);+ setTranscriptionCompleted(true);+ setProgress(0);+ });+ }}+ >+ Transcribe+ </button>+ {transcribing && <progress max={1} value={progress} />}+ </div>+ </div>+ );+}diff --git a/pnpm-lock.yaml b/pnpm-lock.yamlindex 5ce1e91949..a6c480b35e 100644--- a/pnpm-lock.yaml+++ b/pnpm-lock.yaml@@ -3700,6 +3700,9 @@ importers:specifier: 19.0.0version: 19.0.0([email protected])devDependencies:+ '@remotion/eslint-config-internal':+ specifier: workspace:*+ version: link:../eslint-config-internal'@types/react':specifier: 19.0.0version: 19.0.0