mirror of
https://github.com/jakejarvis/sofa.git
synced 2026-08-29 01:35:39 -04:00
- New `lists` service fetches Sonarr/Radarr library via their REST APIs and auto-imports matching titles from TMDB into the user's watchlist - `app/api/lists/[token]/route.ts` webhook endpoint triggers a list sync - Unified `IntegrationCard` component replaces `WebhookCard`, handling both webhook-style (Plex/Jellyfin/Emby) and list-style (Sonarr/Radarr) integrations with per-type config forms - Schema migration adds `sonarr` and `radarr` to the integration type enum and a `listConnections` table for list-based integrations - 212 tests added for the lists service covering import, deduplication, and error handling
38 lines
1020 B
TypeScript
38 lines
1020 B
TypeScript
"use client";
|
|
|
|
import { IconWebhook } from "@tabler/icons-react";
|
|
import { useHydrateAtoms } from "jotai/utils";
|
|
import { connectionsAtom } from "@/lib/atoms/integrations";
|
|
import {
|
|
IntegrationCard,
|
|
type IntegrationConnection,
|
|
} from "./integration-card";
|
|
import { INTEGRATION_CONFIGS } from "./integration-configs";
|
|
|
|
export function IntegrationsSection({
|
|
initialConnections,
|
|
}: {
|
|
initialConnections: IntegrationConnection[];
|
|
}) {
|
|
useHydrateAtoms([[connectionsAtom, initialConnections]]);
|
|
|
|
return (
|
|
<div>
|
|
<div className="mb-3 flex items-center gap-2">
|
|
<IconWebhook
|
|
aria-hidden={true}
|
|
className="size-4 text-muted-foreground"
|
|
/>
|
|
<h2 className="text-xs font-medium uppercase tracking-wider text-muted-foreground">
|
|
Integrations
|
|
</h2>
|
|
</div>
|
|
<div className="space-y-3">
|
|
{INTEGRATION_CONFIGS.map((config) => (
|
|
<IntegrationCard key={config.provider} config={config} />
|
|
))}
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|