format everything in zed

This commit is contained in:
2025-10-27 18:20:34 +08:00
parent 99c58217c9
commit 4529c58aad
34 changed files with 1927 additions and 1609 deletions

View File

@@ -1,21 +1,19 @@
import Button from "@/components/Button";
import { useRef } from "react";
export default function UploadArea(
{
setVideoUrl,
setSrtUrl
}: {
setVideoUrl: (url: string | null) => void;
setSrtUrl: (url: string | null) => void;
}
) {
export default function UploadArea({
setVideoUrl,
setSrtUrl,
}: {
setVideoUrl: (url: string | null) => void;
setSrtUrl: (url: string | null) => void;
}) {
const inputRef = useRef<HTMLInputElement>(null);
const uploadVideo = () => {
const input = inputRef.current;
if (input) {
input.setAttribute('accept', 'video/*');
input.setAttribute("accept", "video/*");
input.click();
input.onchange = () => {
const file = input.files?.[0];
@@ -24,11 +22,11 @@ export default function UploadArea(
}
};
}
}
};
const uploadSRT = () => {
const input = inputRef.current;
if (input) {
input.setAttribute('accept', '.srt');
input.setAttribute("accept", ".srt");
input.click();
input.onchange = () => {
const file = input.files?.[0];
@@ -37,12 +35,12 @@ export default function UploadArea(
}
};
}
}
};
return (
<div className="w-full flex flex-col gap-2 m-2">
<Button onClick={uploadVideo}></Button>
<Button onClick={uploadSRT}></Button>
<input type="file" className="hidden" ref={inputRef} />
</div >
)
}
</div>
);
}