-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Table is mostly working and started work on the modal
- Loading branch information
Showing
9 changed files
with
75 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import AudioPreview from "@/components/audio-preview"; | ||
|
||
export default function FullAudioPage({ | ||
params, | ||
}: { | ||
params: { name: string }; | ||
}) { | ||
return ( | ||
<main className="h-full w-full"> | ||
<AudioPreview name={params.name} /> | ||
</main> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
"use client"; | ||
|
||
import { getUserData } from "@/app/actions"; | ||
import { | ||
useQuery, | ||
QueryClientProvider, | ||
QueryClient, | ||
} from "@tanstack/react-query"; | ||
|
||
const queryClient = new QueryClient(); | ||
|
||
async function getRecording(name: string) { | ||
const userData = await getUserData(); | ||
if (!userData) { | ||
console.error("Error getting user data"); | ||
return null; | ||
} | ||
|
||
try { | ||
const url = `${userData.whishperURL}/api/documents/${name}/download/`; | ||
const response = await fetch(url); | ||
if (response.ok) { | ||
const blob = await response.blob(); | ||
return URL.createObjectURL(blob); | ||
} | ||
} catch (error) { | ||
console.error("An error occurred:", error); | ||
return null; | ||
} | ||
} | ||
|
||
function AudioPreview(props: { name: string }) { | ||
const { data: url, isLoading } = useQuery({ | ||
queryKey: ["audioURL", props.name], | ||
queryFn: async () => { | ||
return getRecording(props.name); | ||
}, | ||
}); | ||
|
||
return <p>{url}</p>; | ||
} | ||
|
||
export default function Page(props: { name: string }) { | ||
return ( | ||
<QueryClientProvider client={queryClient}> | ||
<AudioPreview name={props.name} /> | ||
</QueryClientProvider> | ||
); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters