diff --git a/src/pages/NewIssue/index.tsx b/src/pages/NewIssue/index.tsx index b37346e5..64c131b6 100644 --- a/src/pages/NewIssue/index.tsx +++ b/src/pages/NewIssue/index.tsx @@ -1,4 +1,4 @@ -import React, { useState } from "react"; +import React, { useState, useEffect } from "react"; import { useNavigate } from "react-router-dom"; import { Terminal, @@ -61,8 +61,27 @@ export default function NewIssue() { const [severity, setSeverity] = useState("P3"); const [isSubmitting, setIsSubmitting] = useState(false); const [error, setError] = useState(null); + const [showDisclaimer, setShowDisclaimer] = useState(false); + + useEffect(() => { + const hasAcceptedDisclaimer = localStorage.getItem("tftsr-ai-disclaimer-accepted"); + if (!hasAcceptedDisclaimer) { + setShowDisclaimer(true); + } + }, []); + + const handleAcceptDisclaimer = () => { + localStorage.setItem("tftsr-ai-disclaimer-accepted", "true"); + setShowDisclaimer(false); + }; const handleStartTriage = async () => { + const hasAcceptedDisclaimer = localStorage.getItem("tftsr-ai-disclaimer-accepted"); + if (!hasAcceptedDisclaimer) { + setShowDisclaimer(true); + return; + } + if (!selectedDomain || !title.trim()) return; setIsSubmitting(true); setError(null); @@ -77,6 +96,82 @@ export default function NewIssue() { }; return ( + <> + {/* AI Disclaimer Modal */} + {showDisclaimer && ( +
+
+

AI-Assisted Triage Disclaimer

+ +
+

+ ⚠️ IMPORTANT: Read Carefully Before Proceeding +

+ +

+ This application uses artificial intelligence (AI) to assist with IT issue triage, root cause analysis, + and troubleshooting recommendations. While AI can be a powerful tool, you must understand its + limitations and your responsibilities. +

+ +
+

AI Can Make Mistakes:

+
    +
  • AI models may provide incorrect, incomplete, or outdated information
  • +
  • AI can hallucinate — generating plausible-sounding but entirely false information
  • +
  • Recommendations may not apply to your specific environment or configuration
  • +
  • Commands suggested by AI may have unintended consequences including data loss, system downtime, or security vulnerabilities
  • +
+
+ +
+

You Are Fully Responsible:

+
    +
  • You are solely responsible for any commands you execute, changes you make, or actions you take based on AI recommendations
  • +
  • Always verify AI suggestions against official documentation, best practices, and your organization's policies
  • +
  • Test in non-production environments before applying changes to production systems
  • +
  • Understand commands before executing them — never blindly run suggested commands
  • +
  • Have backups and rollback plans in place before making system changes
  • +
+
+ +

+ Best Practices: +

+
    +
  • Treat AI recommendations as a starting point for investigation, not definitive answers
  • +
  • Consult with senior engineers or subject matter experts when dealing with critical systems
  • +
  • Review all AI-generated content for accuracy and relevance to your specific situation
  • +
  • Maintain proper change control and approval processes
  • +
  • Document your actions and decision-making process
  • +
+ +

+ By clicking "I Understand and Accept," you acknowledge that you have read and understood this disclaimer, + and you accept full responsibility for any actions taken based on information provided by this AI-assisted + system. Use at your own risk. +

+
+ +
+ + +
+
+
+ )} +

New Issue

@@ -155,5 +250,6 @@ export default function NewIssue() { {isSubmitting ? "Creating..." : "Start Triage"}
+ ); }