Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions apps/web/components/chat/message/user-message.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client"

import { memo } from "react"
import { Copy, Check } from "lucide-react"
import type { UIMessage } from "@ai-sdk/react"

Expand All @@ -9,7 +10,7 @@ interface UserMessageProps {
onCopy: (messageId: string, text: string) => void
}

export function UserMessage({
export const UserMessage = memo(function UserMessage({
message,
copiedMessageId,
onCopy,
Expand Down Expand Up @@ -38,4 +39,4 @@ export function UserMessage({
</button>
</div>
)
}
})
10 changes: 7 additions & 3 deletions apps/web/components/document-cards/file-preview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import { useState } from "react"
import { memo, useState } from "react"
import type { DocumentsWithMemoriesResponseSchema } from "@repo/validation/api"
import type { z } from "zod"
import { dmSansClassName } from "@/lib/fonts"
Expand Down Expand Up @@ -43,7 +43,11 @@ function getFileTypeInfo(document: DocumentWithMemories): {
}
}

export function FilePreview({ document }: { document: DocumentWithMemories }) {
export const FilePreview = memo(function FilePreview({
document,
}: {
document: DocumentWithMemories
}) {
const [imageError, setImageError] = useState(false)
const { extension, color } = getFileTypeInfo(document)

Expand Down Expand Up @@ -107,4 +111,4 @@ export function FilePreview({ document }: { document: DocumentWithMemories }) {
)}
</div>
)
}
})
6 changes: 3 additions & 3 deletions apps/web/components/document-cards/website-preview.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import { useState } from "react"
import { memo, useState } from "react"
import type { DocumentsWithMemoriesResponseSchema } from "@repo/validation/api"
import type { z } from "zod"

Expand All @@ -12,7 +12,7 @@ type OgData = {
image?: string
}

export function WebsitePreview({
export const WebsitePreview = memo(function WebsitePreview({
document,
ogData,
}: {
Expand Down Expand Up @@ -40,4 +40,4 @@ export function WebsitePreview({
) : null}
</div>
)
}
})
5 changes: 3 additions & 2 deletions apps/web/components/document-cards/youtube-preview.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
"use client"

import { memo } from "react"
import type { DocumentsWithMemoriesResponseSchema } from "@repo/validation/api"
import type { z } from "zod"
import { dmSansClassName } from "@/lib/fonts"
Expand All @@ -9,7 +10,7 @@ import { extractYouTubeVideoId } from "../utils"
type DocumentsResponse = z.infer<typeof DocumentsWithMemoriesResponseSchema>
type DocumentWithMemories = DocumentsResponse["documents"][0]

export function YoutubePreview({
export const YoutubePreview = memo(function YoutubePreview({
document,
}: {
document: DocumentWithMemories
Expand Down Expand Up @@ -49,4 +50,4 @@ export function YoutubePreview({
</div>
</div>
)
}
})
Loading