diff --git a/apps/mail/components/context/sidebar-context.tsx b/apps/mail/components/context/sidebar-context.tsx
index 967505ac08..c23ee1cd48 100644
--- a/apps/mail/components/context/sidebar-context.tsx
+++ b/apps/mail/components/context/sidebar-context.tsx
@@ -113,7 +113,7 @@ export const SidebarProvider = React.forwardRef<
} as React.CSSProperties
}
className={cn(
- 'group/sidebar-wrapper has-[[data-variant=inset]]:bg-sidebar flex min-h-svh w-full',
+ 'group/sidebar-wrapper has-data-[variant=inset]:bg-sidebar flex min-h-svh w-full',
className,
)}
ref={ref}
diff --git a/apps/mail/components/create/ai-chat.tsx b/apps/mail/components/create/ai-chat.tsx
index e0c7a4e352..d19ad7a6b4 100644
--- a/apps/mail/components/create/ai-chat.tsx
+++ b/apps/mail/components/create/ai-chat.tsx
@@ -3,12 +3,14 @@ import { useAIFullScreen, useAISidebar } from '../ui/ai-sidebar';
import { VoiceProvider } from '@/providers/voice-provider';
import useComposeEditor from '@/hooks/use-compose-editor';
import { useRef, useCallback, useEffect } from 'react';
+import type { useAgentChat } from 'agents/ai-react';
import { Markdown } from '@react-email/components';
import { useBilling } from '@/hooks/use-billing';
import { TextShimmer } from '../ui/text-shimmer';
import { useThread } from '@/hooks/use-threads';
import { MailLabels } from '../mail/mail-list';
import { cn, getEmailLogo } from '@/lib/utils';
+import type { Message as AiMessage } from 'ai';
import { VoiceButton } from '../voice-button';
import { EditorContent } from '@tiptap/react';
import { CurvedArrow } from '../icons/icons';
@@ -69,7 +71,6 @@ const ThreadPreview = ({ threadId }: { threadId: string }) => {
};
const ExampleQueries = ({ onQueryClick }: { onQueryClick: (query: string) => void }) => {
-
const firstRowQueries = [
'Find invoice from Stripe',
'Show unpaid invoices',
@@ -79,7 +80,7 @@ const ExampleQueries = ({ onQueryClick }: { onQueryClick: (query: string) => voi
const secondRowQueries = ['Find all work meetings', 'What projects do i have coming up'];
return (
-
+
{/* First row */}
@@ -87,7 +88,8 @@ const ExampleQueries = ({ onQueryClick }: { onQueryClick: (query: string) => voi
))}
@@ -100,7 +102,7 @@ const ExampleQueries = ({ onQueryClick }: { onQueryClick: (query: string) => voi
@@ -108,31 +110,31 @@ const ExampleQueries = ({ onQueryClick }: { onQueryClick: (query: string) => voi
{/* Left mask */}
-
+
{/* Right mask */}
-
+
);
};
-interface Message {
- id: string;
- role: 'user' | 'assistant' | 'data' | 'system';
- parts: Array<{
- type: string;
- text?: string;
- toolInvocation?: {
- toolName: string;
- result?: {
- threads?: Array<{ id: string; title: string; snippet: string }>;
- };
- args?: any;
- };
- }>;
-}
+// interface Message {
+// id: string;
+// role: 'user' | 'assistant' | 'data' | 'system';
+// parts: Array<{
+// type: string;
+// text?: string;
+// toolInvocation?: {
+// toolName: string;
+// result?: {
+// threads?: Array<{ id: string; title: string; snippet: string }>;
+// };
+// args?: any;
+// };
+// }>;
+// }
export interface AIChatProps {
- messages: Message[];
+ messages: AiMessage[];
input: string;
setInput: (input: string) => void;
error?: Error;
@@ -141,6 +143,7 @@ export interface AIChatProps {
stop: () => void;
className?: string;
onModelChange?: (model: string) => void;
+ setMessages: (messages: AiMessage[]) => void;
}
// Subcomponents for ToolResponse
@@ -198,7 +201,7 @@ export function AIChat({
error,
handleSubmit,
status,
-}: AIChatProps): React.ReactElement {
+}: ReturnType
): React.ReactElement {
const messagesEndRef = useRef(null);
const messagesContainerRef = useRef(null);
const { chatMessages } = useBilling();
@@ -233,7 +236,7 @@ export function AIChat({
},
});
- const onSubmit = (e: React.FormEvent) => {
+ const onSubmit = async (e: React.FormEvent) => {
e.preventDefault();
handleSubmit(e);
editor.commands.clearContent(true);
@@ -260,13 +263,13 @@ export function AIChat({
{chatMessages && !chatMessages.enabled ? (
setPricingDialog('true')}
- className="absolute inset-0 flex flex-col items-center justify-center"
- >
-
- Upgrade to Zero Pro for unlimited AI chat
-
-
+ onClick={() => setPricingDialog('true')}
+ className="absolute inset-0 flex flex-col items-center justify-center"
+ >
+
+ Upgrade to Zero Pro for unlimited AI chat
+
+
) : !messages.length ? (
@@ -365,7 +368,7 @@ export function AIChat({
{/* Fixed input at bottom */}
-
+
@@ -402,7 +405,7 @@ export function AIChat({
- {/*
+ {/*