@@ -137,7 +131,7 @@ export function Webhooks({ videoId }: WebhooksProps) {
diff --git a/src/app/(app)/videos/[id]/tabs/webhooks/metadata-tooltip.tsx b/apps/web/src/app/(app)/videos/[id]/tabs/webhooks/metadata-tooltip.tsx
similarity index 100%
rename from src/app/(app)/videos/[id]/tabs/webhooks/metadata-tooltip.tsx
rename to apps/web/src/app/(app)/videos/[id]/tabs/webhooks/metadata-tooltip.tsx
diff --git a/src/app/(app)/videos/[id]/tabs/webhooks/webhooks-skeleton-table.tsx b/apps/web/src/app/(app)/videos/[id]/tabs/webhooks/webhooks-skeleton-table.tsx
similarity index 100%
rename from src/app/(app)/videos/[id]/tabs/webhooks/webhooks-skeleton-table.tsx
rename to apps/web/src/app/(app)/videos/[id]/tabs/webhooks/webhooks-skeleton-table.tsx
diff --git a/src/app/(app)/videos/[id]/transcription-card/index.tsx b/apps/web/src/app/(app)/videos/[id]/transcription-card/index.tsx
similarity index 79%
rename from src/app/(app)/videos/[id]/transcription-card/index.tsx
rename to apps/web/src/app/(app)/videos/[id]/transcription-card/index.tsx
index a8bcbea..9a2e527 100644
--- a/src/app/(app)/videos/[id]/transcription-card/index.tsx
+++ b/apps/web/src/app/(app)/videos/[id]/transcription-card/index.tsx
@@ -1,8 +1,6 @@
'use client'
import { zodResolver } from '@hookform/resolvers/zod'
-import { useQuery } from '@tanstack/react-query'
-import axios from 'axios'
import { Loader2 } from 'lucide-react'
import { Fragment, useRef, useState } from 'react'
import { Controller, useForm } from 'react-hook-form'
@@ -13,7 +11,7 @@ import { Card, CardContent, CardFooter } from '@/components/ui/card'
import { Label } from '@/components/ui/label'
import { ScrollArea } from '@/components/ui/scroll-area'
import { Switch } from '@/components/ui/switch'
-import { api } from '@/lib/eden'
+import { trpc } from '@/lib/trpc/react'
import { Segment } from './segment'
import { TranscriptionSkeleton } from './transcription-skeleton'
@@ -42,35 +40,34 @@ export function TranscriptionCard({
}: TranscriptionCardProps) {
const [shouldFollowUserFocus, setShouldFollowUserFocus] = useState(true)
- const { data: transcription } = useQuery({
- queryKey: ['transcription', videoId],
- queryFn: async () => {
- const { data, error } = await api.videos[videoId].transcription.get()
-
- if (error) {
- throw error
- }
+ const { data: videoDownloadData } = trpc.requestMediaDownloadUrl.useQuery({
+ videoId,
+ media: 'video',
+ })
- return data.transcription
+ const { data } = trpc.getUploadTranscription.useQuery(
+ {
+ videoId,
},
- refetchInterval(data) {
- const isTranscriptionAlreadyLoaded = !!data
+ {
+ refetchInterval(data) {
+ const isTranscriptionAlreadyLoaded = !!data
- if (isTranscriptionAlreadyLoaded) {
- return false
- }
+ if (isTranscriptionAlreadyLoaded) {
+ return false
+ }
- return 15 * 1000 // 15 seconds
+ return 15 * 1000 // 15 seconds
+ },
+ refetchOnWindowFocus: false,
},
- refetchOnWindowFocus: false,
- })
+ )
const videoRef = useRef
(null)
const {
register,
control,
- handleSubmit,
formState: { isSubmitting },
} = useForm({
resolver: zodResolver(transcriptionSegmentsFormSchema),
@@ -83,33 +80,27 @@ export function TranscriptionCard({
}
}
- async function handleSaveTranscriptionSegments(
- data: TranscriptionSegmentsFormSchema,
- ) {
- // await saveTranscriptions(data)
- }
-
return (
- {shouldDisplayVideo && (
+ {shouldDisplayVideo && videoDownloadData?.downloadUrl && (
)}
- {transcription ? (
+ {data?.transcription ? (
- {transcription.segments.map((segment, index: number) => {
+ {data.transcription.segments.map((segment, index) => {
return (
)}
-
- ) : videos && videos.length === 0 ? (
+ ) : data?.videos && data.videos.length === 0 ? (
No results found.
) : (
- videos &&
- videos.map((video) => {
+ data?.videos &&
+ data.videos.map((video) => {
return (
- handleItemSelected(video.id)}
+
-
- {video.title}
-
- {dayjs(video.createdAt).fromNow()}
-
-
+ onRequestClose={() => setOpen(false)}
+ video={video}
+ />
)
})
)}
diff --git a/src/components/theme-switcher.tsx b/apps/web/src/components/header/theme-switcher.tsx
similarity index 96%
rename from src/components/theme-switcher.tsx
rename to apps/web/src/components/header/theme-switcher.tsx
index 25885de..4738ebb 100644
--- a/src/components/theme-switcher.tsx
+++ b/apps/web/src/components/header/theme-switcher.tsx
@@ -18,7 +18,7 @@ export function ThemeSwitcher() {
return (
-
+
Toggle theme
diff --git a/src/components/user-profile-button.tsx b/apps/web/src/components/header/user-profile-button.tsx
similarity index 53%
rename from src/components/user-profile-button.tsx
rename to apps/web/src/components/header/user-profile-button.tsx
index 83fcc99..5874281 100644
--- a/src/components/user-profile-button.tsx
+++ b/apps/web/src/components/header/user-profile-button.tsx
@@ -1,9 +1,9 @@
-import { LogOut } from 'lucide-react'
+import { auth, signOut } from '@nivo/auth'
+import { Code, Cog, LogOut } from 'lucide-react'
import Image from 'next/image'
+import Link from 'next/link'
-import { auth, signOut } from '@/auth'
-
-import { Avatar } from './ui/avatar'
+import { Avatar } from '../ui/avatar'
import {
DropdownMenu,
DropdownMenuContent,
@@ -11,7 +11,7 @@ import {
DropdownMenuLabel,
DropdownMenuSeparator,
DropdownMenuTrigger,
-} from './ui/dropdown-menu'
+} from '../ui/dropdown-menu'
export async function UserProfileButton() {
const session = await auth()
@@ -28,24 +28,36 @@ export async function UserProfileButton() {
{session?.user && session?.user.image ? (
) : (
-
+
)}
-
+
My Account
+
+
+
+ Settings
+
+
+
+
+
+ Developers
+
+
- ) : tagOptions && tagOptions.length === 0 ? (
+ ) : data?.tags && data.tags.length === 0 ? (