import React, { useEffect, useState } from 'react'; import { Card } from '../../ui/card'; import { Button } from '../../ui/button'; import { GooseMode, ModeSelectionItem } from './ModeSelectionItem'; interface ConfigureApproveModeProps { onClose: () => void; handleModeChange: (newMode: string) => void; currentMode: string | null; } export function ConfigureApproveMode({ onClose, handleModeChange, currentMode, }: ConfigureApproveModeProps) { const approveModes: GooseMode[] = [ { key: 'approve', label: 'Manual Approval', description: 'All tools, extensions and file modificatio will require human approval', }, { key: 'smart_approve', label: 'Smart Approval', description: 'Intelligently determine which actions need approval based on risk level ', }, ]; const [isSubmitting, setIsSubmitting] = useState(false); const [approveMode, setApproveMode] = useState(currentMode); useEffect(() => { setApproveMode(currentMode); }, [currentMode]); const handleModeSubmit = async (e: React.FormEvent) => { e.preventDefault(); setIsSubmitting(true); try { handleModeChange(approveMode); onClose(); } catch (error) { console.error('Error configuring goose mode:', error); } finally { setIsSubmitting(false); } }; return (
Approve requests can either be given to all tool requests or determine which actions may need integration