fix: complete widget modernization review
This commit is contained in:
1 parent
a38e731209
commit
0f9d038aaf
29 files changed
+595
-257
No files matched your search
@@ -7,6 +7,7 @@ import { formatBytes, formatDuration } from "@homarr/common";
|
||||
import type { AudiobookshelfDashboardData } from "@homarr/integrations/types";
|
||||
|
||||
import { WidgetEmptyState } from "../common/empty-state";
|
||||
import { IntegrationErrorIndicator } from "../common/integration-error-indicator";
|
||||
import type { WidgetComponentProps } from "../definition";
|
||||
import { setWidgetRuntimeQueries } from "../definition";
|
||||
import { AudioStatsContent } from "./audio-stats-content";
|
||||
@@ -46,9 +47,15 @@ export default function AudioStatsWidget({
|
||||
const sessions = streamResults.flatMap((result) =>
|
||||
result.sessions.map((session) => ({ integrationId: result.integrationId, session })),
|
||||
);
|
||||
const hasStreamFailures = streamResults.some(({ error }) => Boolean(error));
|
||||
const audiobookStats = response.kind === "audiobookshelf" ? (response.data as AudiobookshelfDashboardData) : null;
|
||||
return (
|
||||
<Stack h="100%" gap="lg" p="md">
|
||||
{hasStreamFailures && (
|
||||
<Group justify="flex-end">
|
||||
<IntegrationErrorIndicator results={streamResults} />
|
||||
</Group>
|
||||
)}
|
||||
<div style={{ minHeight: 150 }}>{summary}</div>
|
||||
<ScrollArea style={{ flex: 1, minHeight: 0 }}>
|
||||
{response.kind === "navidrome" ? (
|
||||
|
||||
Reference in new issue
Block a user