diff --git a/src/app/actions.ts b/src/app/actions.ts index c1b98c6..90b49c5 100644 --- a/src/app/actions.ts +++ b/src/app/actions.ts @@ -78,3 +78,8 @@ export async function getPaperlessDocuments(query: string) { return data; } + +export async function formatWhishperName(name: string) { + const frontPart = name.split("_WHSHPR_")[1] ?? name; + return frontPart.replace(".m4a", "") ?? name; +} diff --git a/src/app/whishper/page.tsx b/src/app/whishper/page.tsx index d94fe44..13baf2c 100644 --- a/src/app/whishper/page.tsx +++ b/src/app/whishper/page.tsx @@ -22,7 +22,7 @@ import { QueryClientProvider, QueryClient, } from "@tanstack/react-query"; -import { getUserData } from "../actions"; +import { formatWhishperName, getUserData } from "../actions"; import LoadingSpinner from "@/components/loading-spinner"; import type { WhishperRecordingType } from "@/types"; import OpenInternalLink from "@/components/internal-link"; diff --git a/src/components/audio-preview.tsx b/src/components/audio-preview.tsx index 1158d19..bee2729 100644 --- a/src/components/audio-preview.tsx +++ b/src/components/audio-preview.tsx @@ -7,6 +7,7 @@ import { } from "@tanstack/react-query"; import type { UsersTableType } from "@/server/db/schema"; import { Button } from "@/components/ui/button"; +import { formatWhishperName } from "@/app/actions"; const queryClient = new QueryClient(); @@ -22,18 +23,20 @@ const fetchUserData = async (): Promise => { function SkeletonLoader() { return (
-
+
-
- {/* Long Pill Skeleton */} -
-
+
+ {/* Title Skeleton */} +
+ {/* Audio Skeleton */} +
+
- {/* Button Skeleton */} -
-
-
-
+ {/* Button Skeletons */} +
+
+
+
@@ -47,14 +50,18 @@ function AudioInfo(props: { name: string }) { const { data: userData, - isLoading, + isLoading: isUserDataLoading, error, } = useQuery({ queryKey: ["userData"], queryFn: fetchUserData, }); - if (isLoading) { + const decodedName = decodeURIComponent(props.name); + const frontPart = decodedName.split("_WHSHPR_")[1] ?? decodedName; + const formattedName = frontPart.replace(".m4a", "") ?? decodedName; + + if (isUserDataLoading) { return ; } if (!userData?.whishperURL ?? error) { @@ -62,15 +69,15 @@ function AudioInfo(props: { name: string }) { } return ( -
+
-
-
-
-
+
+

+ {formattedName} +

{/* Audio */} -
+
-
diff --git a/src/components/document-viewer.tsx b/src/components/document-viewer.tsx index d5cfeac..97d0f02 100644 --- a/src/components/document-viewer.tsx +++ b/src/components/document-viewer.tsx @@ -60,7 +60,7 @@ function SkeletonLoader() { {/* PDF Skeleton */}
{/* Pulsing Background */} -
+
{/* Text Overlay */}
@@ -74,13 +74,9 @@ function SkeletonLoader() {
{/* Button Skeleton */}
-
-
-
-
-
-
-
+ {Array.from({ length: 7 }, (_, index) => ( +
+ ))}