@flowselections/floriday-authenticatie-module 1.0.3 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FlorydaySettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/FlorydaySettingsCard.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FlorydaySettingsCard.d.ts","sourceRoot":"","sources":["../../../src/components/settings/FlorydaySettingsCard.tsx"],"names":[],"mappings":"AA4CA,wBAAgB,oBAAoB,4CAiHnC"}
|
|
@@ -4,7 +4,6 @@ import { ChevronDown } from "lucide-react";
|
|
|
4
4
|
import { useServerFn } from "@tanstack/react-start";
|
|
5
5
|
import { useQuery, useMutation, useQueryClient } from "@tanstack/react-query";
|
|
6
6
|
import { Card, Button, Input, Label, Badge, Tabs, TabsList, TabsTrigger, Select, SelectContent, SelectItem, SelectTrigger, SelectValue, AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, toast, } from "@flowselections/core";
|
|
7
|
-
import florydayLogo from "@/assets/floriday-logo.png";
|
|
8
7
|
import { listFlorydayConnections, upsertFlorydayConnection, testFlorydayConnection, deleteFlorydayConnection, getFlorydaySettings, setFlorydayActiveEnvironment, listFlorydayWarehouses, updateFlorydayPublishingSettings, validateGln, } from "../../lib/floriday.functions";
|
|
9
8
|
export function FlorydaySettingsCard() {
|
|
10
9
|
const [open, setOpen] = useState(false);
|
|
@@ -39,7 +38,7 @@ export function FlorydaySettingsCard() {
|
|
|
39
38
|
toast.success(`Gebruik modus: ${env === "live" ? "Live omgeving" : "Testomgeving"}`);
|
|
40
39
|
},
|
|
41
40
|
});
|
|
42
|
-
return (_jsxs(Card, { className: "overflow-hidden border-border/60", children: [_jsxs("button", { type: "button", onClick: () => setOpen(o => !o), className: "w-full flex items-center gap-3 px-5 py-4 text-left hover:bg-muted/40 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", "aria-expanded": open, children: [_jsx("div", { className: "h-9 w-9 rounded-lg bg-muted/60 flex items-center justify-center shrink-0", children: _jsx("
|
|
41
|
+
return (_jsxs(Card, { className: "overflow-hidden border-border/60", children: [_jsxs("button", { type: "button", onClick: () => setOpen(o => !o), className: "w-full flex items-center gap-3 px-5 py-4 text-left hover:bg-muted/40 transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-inset", "aria-expanded": open, children: [_jsx("div", { className: "h-9 w-9 rounded-lg bg-muted/60 flex items-center justify-center shrink-0", children: _jsx("span", { className: "flex h-6 w-6 items-center justify-center rounded bg-green-600 text-xs font-bold text-white", children: "F" }) }), _jsxs("div", { className: "flex-1 min-w-0", children: [_jsx("h3", { className: "font-semibold text-sm truncate", children: "Floriday koppeling" }), _jsxs("div", { className: "flex items-center gap-2 flex-wrap mt-1", children: [_jsx(Badge, { variant: activeEnv === "live" ? "default" : "secondary", className: "text-[10px] tracking-wide", children: activeEnv === "live" ? "Live omgeving" : "Testomgeving" }), _jsx(StatusIndicator, { connected: Boolean(activeConn) }), activeConn?.organization_name && (_jsxs("span", { className: "text-xs text-muted-foreground truncate", children: ["\u00B7 ", activeConn.organization_name] }))] }), _jsx("p", { className: "text-xs text-muted-foreground mt-1 truncate", children: "Verbind je Floriday-account om automatisch gegevens uit te wisselen met het platform." })] }), _jsx(ChevronDown, { className: `h-4 w-4 text-muted-foreground shrink-0 transition-transform ${open ? "rotate-180" : ""}` })] }), open && (_jsxs("div", { className: "border-t border-border/60 px-5 py-5 space-y-6 bg-muted/20", children: [_jsx(StepBlock, { number: 1, title: "Kies omgeving", description: "Kies of je wilt testen of live wilt werken.", children: _jsx(Tabs, { value: activeEnv, onValueChange: (v) => envMutation.mutate(v), children: _jsxs(TabsList, { className: "grid grid-cols-2 w-full max-w-xs", children: [_jsx(TabsTrigger, { value: "staging", disabled: envMutation.isPending, children: "Testomgeving" }), _jsx(TabsTrigger, { value: "live", disabled: envMutation.isPending, children: "Live omgeving" })] }) }) }), isLoading ? (_jsx("p", { className: "text-sm text-muted-foreground", children: "Laden\u2026" })) : (_jsx(EnvironmentForm, { env: activeEnv, label: activeEnv === "live" ? "Live omgeving" : "Testomgeving", connection: activeConn }, activeEnv)), _jsx("div", { className: "pt-2 border-t border-border/60", children: _jsx("a", { href: "https://developer.floriday.io/docs", target: "_blank", rel: "noopener noreferrer", className: "text-xs text-primary hover:underline inline-flex items-center gap-1", children: "Waar vind ik deze gegevens in Floriday?" }) })] }))] }));
|
|
43
42
|
}
|
|
44
43
|
function StatusIndicator({ connected }) {
|
|
45
44
|
const label = connected ? "Verbonden" : "Niet verbonden";
|