From 5ca121b2ab2e648a9ba1082350a3eac09e4db69b Mon Sep 17 00:00:00 2001 From: Nikhil-Doye Date: Thu, 23 Oct 2025 15:10:22 -0400 Subject: [PATCH] Add SlackWizard component for configuring Slack operations - Introduced SlackWizard component to facilitate the configuration of various Slack operations, including sending messages, managing channels, and setting reminders. - Implemented dynamic form fields based on selected operation type, enhancing user experience with tailored input options. - Added state management for operation selection and configuration updates, ensuring real-time feedback and validation. --- src/components/wizards/SlackWizard.tsx | 452 +++++++++++++++++++++++++ 1 file changed, 452 insertions(+) create mode 100644 src/components/wizards/SlackWizard.tsx diff --git a/src/components/wizards/SlackWizard.tsx b/src/components/wizards/SlackWizard.tsx new file mode 100644 index 0000000..618a22e --- /dev/null +++ b/src/components/wizards/SlackWizard.tsx @@ -0,0 +1,452 @@ +import React, { useState, useEffect } from "react"; +import { SlackConfig, SlackOperation } from "../../types/slack"; + +interface SlackWizardProps { + config: SlackConfig; + onConfigChange: (config: SlackConfig) => void; + onClose: () => void; +} + +export const SlackWizard: React.FC = ({ + config, + onConfigChange, + onClose, +}) => { + const [operation, setOperation] = useState( + config.operation || "message" + ); + + // Update config when operation changes + useEffect(() => { + onConfigChange({ + ...config, + operation, + }); + }, [operation]); + + const renderOperationFields = () => { + switch (operation) { + case "message": + return ( +
+
+ + + onConfigChange({ ...config, channel: e.target.value }) + } + placeholder="#general or @username or C1234567890" + className="mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" + /> +
+
+ +