diff --git a/TelegramDownloader/ClientApp/apps/web/src/app/routes.tsx b/TelegramDownloader/ClientApp/apps/web/src/app/routes.tsx index f27d948..51e2e3e 100644 --- a/TelegramDownloader/ClientApp/apps/web/src/app/routes.tsx +++ b/TelegramDownloader/ClientApp/apps/web/src/app/routes.tsx @@ -1,6 +1,7 @@ import { Navigate, type RouteObject } from 'react-router'; import { TelegramGate, WebAuthGate } from '@/auth/gates'; import { routes as appsRoutes } from '@/features/apps/routes'; +import { routes as audiobooksRoutes } from '@/features/audiobooks/routes'; import { routes as channelsRoutes } from '@/features/channels/routes'; import { routes as chatRoutes } from '@/features/chat/routes'; import { routes as devUiRoutes } from '@/features/dev-ui/routes'; @@ -44,6 +45,7 @@ export const appRoutes: RouteObject[] = [ ...transfersRoutes, ...playlistsRoutes, ...libraryRoutes, + ...audiobooksRoutes, ...searchRoutes, ...chatRoutes, ...settingsRoutes, diff --git a/TelegramDownloader/ClientApp/apps/web/src/features/audiobooks/components/BookCard.tsx b/TelegramDownloader/ClientApp/apps/web/src/features/audiobooks/components/BookCard.tsx new file mode 100644 index 0000000..600d54b --- /dev/null +++ b/TelegramDownloader/ClientApp/apps/web/src/features/audiobooks/components/BookCard.tsx @@ -0,0 +1,55 @@ +import type { ApiAudiobookDto } from '@tfm/api-client'; +import { cn } from '@tfm/ui'; +import { Check, Play } from 'lucide-react'; +import { Link } from 'react-router'; +import { formatLength } from '@/features/player/public'; +import { t } from '@/i18n'; +import { authorsLabel, inProgress, progressPercent, seriesLabel } from '../model'; +import { playBookById } from '../playback'; +import { BookCover } from './BookCover'; + +export function BookProgress({ percent, className }: { percent: number; className?: string }) { + if (percent <= 0) return null; + return ( +
{book.title}
+{authorsLabel(book) || series || ' '}
+ {showProgressText && left > 0 &&{t('{time} left', { time: formatLength(left) })}
} ++ {c.title} + {c.subtitle && · {c.subtitle}} +
+{c.authors.join(', ')}
+ {c.narrators.length > 0 &&{t('Narrated by {names}', { names: c.narrators.join(', ') })}
} +
+