refactor(integrations): make onSuccess required and simplify new page

- Make onSuccess a required prop on NewIntegrationForm so the consumer
  always controls post-creation behavior. Remove internal router.push.
- Add IntegrationNewFormWrapper client component to handle navigation
  for the server-rendered manage page.
- Replace IntegrationPickerPage with a simple "back to overview" button
  when an invalid integration kind is provided. Delete unused
  integration-picker-page.tsx.
This commit is contained in:
Thomas Camlong committed 2026-05-14 16:54:31 +02:00
1 parent 947504a16e
commit 97e39ced44
4 files changed
+101 -83

No files matched your search

@@ -1,25 +0,0 @@
"use client";
import { useCallback } from "react";
import { useRouter } from "next/navigation";
import type { IntegrationKind } from "@homarr/definitions";
import { IntegrationSelectGrid } from "./integration-select-grid";
interface IntegrationPickerPageProps {
enableMockIntegration: boolean;
}
export const IntegrationPickerPage = ({ enableMockIntegration }: IntegrationPickerPageProps) => {
const router = useRouter();
const handleSelect = useCallback(
(kind: IntegrationKind) => {
router.push(`/manage/integrations/new?kind=${kind}`);
},
[router],
);
return <IntegrationSelectGrid onSelect={handleSelect} enableMockIntegration={enableMockIntegration} />;
};