mirror of
https://github.com/theoleuthardt/werkzeugkiste.git
synced 2026-06-13 09:37:53 +00:00
feat: renaming some constants, correct table constant in frontend
This commit is contained in:
parent
903709c334
commit
95c8ba211c
3 changed files with 12 additions and 14 deletions
|
|
@ -4,7 +4,7 @@ import { toolLinks } from "@/constants";
|
||||||
|
|
||||||
export const metadata: Metadata = {
|
export const metadata: Metadata = {
|
||||||
title: toolLinks[8].title,
|
title: toolLinks[8].title,
|
||||||
description: "MP4 to MP3 converter!",
|
description: "Video to audio converter!",
|
||||||
};
|
};
|
||||||
|
|
||||||
export default function RootLayout({
|
export default function RootLayout({
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,7 @@ export default function DocConverter() {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const convertDoc = async () => {
|
const convertVideo = async () => {
|
||||||
if (!file) {
|
if (!file) {
|
||||||
alert("No file selected");
|
alert("No file selected");
|
||||||
return;
|
return;
|
||||||
|
|
@ -57,7 +57,7 @@ export default function DocConverter() {
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const response = await fetch(
|
const response = await fetch(
|
||||||
process.env.backend_url + "/api/video-convert",
|
process.env.backend_url + "/api/video-to-audio",
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
body: formData,
|
body: formData,
|
||||||
|
|
@ -66,6 +66,7 @@ export default function DocConverter() {
|
||||||
|
|
||||||
if (!response.ok) {
|
if (!response.ok) {
|
||||||
console.error(`Error: ${response.statusText}`);
|
console.error(`Error: ${response.statusText}`);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const blob = await response.blob();
|
const blob = await response.blob();
|
||||||
|
|
@ -94,7 +95,7 @@ export default function DocConverter() {
|
||||||
<div className="w-screen h-auto min-h-screen bg-black text-white font-noto flex flex-col items-center">
|
<div className="w-screen h-auto min-h-screen bg-black text-white font-noto flex flex-col items-center">
|
||||||
<Navbar renderHomeLink={true} />
|
<Navbar renderHomeLink={true} />
|
||||||
<div className="w-screen h-auto min-h-[calc(100vh-80px-60px)] flex flex-1 flex-col items-center justify-center">
|
<div className="w-screen h-auto min-h-[calc(100vh-80px-60px)] flex flex-1 flex-col items-center justify-center">
|
||||||
<h2 className="text-5xl font-bold text-white mb-16">doc-converter</h2>
|
<h2 className="text-5xl font-bold text-white mb-16">video-to-audio</h2>
|
||||||
<div className="h-36 flex flex-row items-center justify-center gap-4">
|
<div className="h-36 flex flex-row items-center justify-center gap-4">
|
||||||
<input
|
<input
|
||||||
type="file"
|
type="file"
|
||||||
|
|
@ -113,6 +114,7 @@ export default function DocConverter() {
|
||||||
const selectedFormat =
|
const selectedFormat =
|
||||||
event.currentTarget.textContent?.trim() || "";
|
event.currentTarget.textContent?.trim() || "";
|
||||||
setSelectedOutputFormat(selectedFormat);
|
setSelectedOutputFormat(selectedFormat);
|
||||||
|
console.log(selectedOutputFormat);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -125,7 +127,7 @@ export default function DocConverter() {
|
||||||
"convert"
|
"convert"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
onClick={convertDoc}
|
onClick={convertVideo}
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div className="overflow-hidden text-xl rounded-lg border border-white mb-16 transition-all duration-300 ease-in-out hover:border-blue-400">
|
<div className="overflow-hidden text-xl rounded-lg border border-white mb-16 transition-all duration-300 ease-in-out hover:border-blue-400">
|
||||||
|
|
@ -162,12 +164,8 @@ export default function DocConverter() {
|
||||||
<tbody>
|
<tbody>
|
||||||
{videoAudioFormatsTable.map((format) => (
|
{videoAudioFormatsTable.map((format) => (
|
||||||
<tr key={format.input} className="border-b">
|
<tr key={format.input} className="border-b">
|
||||||
<td className="min-w-96 px-6 py-4 border-r">
|
<td className="w-96 px-6 py-4 border-r">{format.input}</td>
|
||||||
{format.input}
|
<td className="px-6 py-4">{format.output.join(", ")}</td>
|
||||||
</td>
|
|
||||||
<td className="min-w-96 px-6 py-4">
|
|
||||||
{format.output.join(", ")}
|
|
||||||
</td>
|
|
||||||
</tr>
|
</tr>
|
||||||
))}
|
))}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
|
||||||
|
|
@ -172,15 +172,15 @@ export const videoAudioFormats = [
|
||||||
|
|
||||||
export const videoAudioFormatsTable = [
|
export const videoAudioFormatsTable = [
|
||||||
{
|
{
|
||||||
input: ".mp4",
|
input: ".mp4 (MPEG-4)",
|
||||||
output: [".mp3", ".wav", ".aac"],
|
output: [".mp3", ".wav", ".aac"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: ".avi",
|
input: ".avi (Audio Video Interleave)",
|
||||||
output: [".mp3", ".wav", ".aac"],
|
output: [".mp3", ".wav", ".aac"],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
input: ".mov",
|
input: ".mov (Apple QuickTime Movie)",
|
||||||
output: [".mp3", ".wav", ".aac"],
|
output: [".mp3", ".wav", ".aac"],
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue