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" + /> +
+
+ +