Login sequence and inventory/protocol storage groundwork

This commit is contained in:
2026-03-19 05:42:11 +00:00
parent 5b2c7e4506
commit 55bbd6909d
21 changed files with 3882 additions and 157 deletions

View File

@@ -1,4 +1,5 @@
import { useState } from "react";
import { protocolsApi } from "../lib/api";
import { Card } from "./ui/card";
import { Button } from "./ui/button";
import { Textarea } from "./ui/textarea";
@@ -18,13 +19,7 @@ import {
import { Alert, AlertDescription } from "./ui/alert";
import { Tabs, TabsContent, TabsList, TabsTrigger } from "./ui/tabs";
interface SafetyIssue {
type: "critical" | "warning" | "suggestion";
category: string;
message: string;
source?: string;
sourceUrl?: string;
}
import type { SafetyIssue } from "../shared/types";
interface ChatMessage {
id: string;
@@ -85,12 +80,21 @@ export function ProtocolChecker() {
}
];
const handleAnalyze = () => {
const handleAnalyze = async () => {
if (!protocol.trim()) return;
setIsAnalyzing(true);
setTimeout(() => {
setIsAnalyzing(false);
try {
const saved = await protocolsApi.createFromText(
`Protocol ${new Date().toLocaleDateString()}`,
protocol
);
await protocolsApi.saveAnalysis(saved.id, mockIssues);
setAnalyzed(true);
}, 2000);
} catch (err) {
console.error("Failed to save protocol:", err);
} finally {
setIsAnalyzing(false);
}
};
const handleSendMessage = () => {