-
Notifications
You must be signed in to change notification settings - Fork 13
Expand file tree
/
Copy pathpage.tsx
More file actions
137 lines (127 loc) · 4.39 KB
/
page.tsx
File metadata and controls
137 lines (127 loc) · 4.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
"use client";
import type React from "react";
import { useState, useEffect } from "react";
import {
MessageSquare,
Bot,
User,
Search,
FileText,
BarChart3Icon as Diagram3,
HelpCircle,
FlaskConical,
} from "lucide-react";
import { Button } from "@/components/ui/button";
import { Alert, AlertDescription } from "@/components/ui/alert";
import { OnboardingModal } from "@/components/onboarding-modal";
import { ChatBox } from "@/components/ChatBox";
export default function ChatPage() {
const [showOnboarding, setShowOnboarding] = useState(false);
useEffect(() => {
// Check if user has seen onboarding before
const hasSeenOnboarding = localStorage.getItem("vcell-ai-onboarding-seen");
if (!hasSeenOnboarding) {
setShowOnboarding(true);
}
}, []);
const handleOnboardingClose = () => {
localStorage.setItem("vcell-ai-onboarding-seen", "true");
setShowOnboarding(false);
};
// Prepare props for ChatBox
const startMessage = `I'm here to help you with **biomodel analysis**, **vcell software** and **research support** .\nFeel free to ask anything! 🚀`;
const quickActions = [
{
label: "List all tutorial models",
icon: <Search className="h-3 w-3 mr-2" />,
value: "List all tutorial models",
},
{
label: "List Calcium models",
icon: <FileText className="h-3 w-3 mr-2" />,
value: "List all Calcium models",
},
{
label: "List all models by ModelBrick",
icon: <User className="h-3 w-3 mr-2" />,
value: "List all models by ModelBrick",
},
{
label: "What solvers are used in tutorial models",
icon: <Diagram3 className="h-3 w-3 mr-2" />,
value: "What solvers are used in tutorial models",
},
/* {
label:
"What are different types of VCell applications used in Tutorial models",
icon: <MessageSquare className="h-3 w-3 mr-2" />,
value:
"What are different types of VCell applications used in Tutorial models",
}, */
{
label: "What Tutorial models use Spatial Stochastic applications?",
icon: <Bot className="h-3 w-3 mr-2" />,
value: "What Tutorial models use Spatial Stochastic applications?",
},
];
const supplementalActions = [
{
label: "How to create an account on VCell Software?",
icon: <User className="h-3 w-3 mr-2" />,
value: "How to create an account on VCell Software?",
},
{
label: "How to model FRAP Bindings in VCell Software?",
icon: <FileText className="h-3 w-3 mr-2" />,
value: "How to model FRAP Bindings in VCell Software?",
},
{
label: "How to model Moving Boundaries in VCell Software?",
icon: <FlaskConical className="h-3 w-3 mr-2" />,
value: "How to model Moving Boundaries in VCell Software?",
},
];
const cardTitle = "VCell AI Assistant";
return (
<div className="h-screen bg-slate-50 flex flex-col">
<div className="container mx-auto p-6 max-w-7xl flex-1 flex flex-col min-h-0">
{/* Header */}
<div className="mb-4 flex-shrink-0">
<div className="flex items-center justify-between mb-1">
<div className="flex items-center gap-4 w-full">
{/* Warning Alert - takes most of the space */}
<Alert className="border-amber-200 bg-amber-50 py-2 flex-1">
<AlertDescription className="text-amber-800 text-sm">
<strong>⚠️ Important:</strong> Responses are AI generated and may contain errors, or hallucinations.
</AlertDescription>
</Alert>
<Button
variant="outline"
size="sm"
onClick={() => setShowOnboarding(true)}
className="flex items-center gap-2 flex-shrink-0"
>
<HelpCircle className="h-4 w-4" />
How to Use
</Button>
</div>
</div>
</div>
{/* Chat Interface - takes remaining space */}
<div className="flex-1 w-full min-h-0">
<ChatBox
startMessage={[startMessage]}
quickActions={quickActions}
supplementalActions={supplementalActions}
cardTitle={cardTitle}
/>
</div>
</div>
{/* Onboarding Modal */}
<OnboardingModal
isOpen={showOnboarding}
onClose={handleOnboardingClose}
/>
</div>
);
}