继续处理会话区多语言
This commit is contained in:
@@ -5,6 +5,7 @@ import type { ComponentProps } from "react"
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { cn } from "@/lib/utils"
|
||||
import { ArrowDownIcon, DownloadIcon } from "lucide-react"
|
||||
import { useTranslations } from "next-intl"
|
||||
import { useCallback } from "react"
|
||||
import { StickToBottom, useStickToBottomContext } from "use-stick-to-bottom"
|
||||
|
||||
@@ -42,32 +43,37 @@ export type MessageThreadEmptyStateProps = ComponentProps<"div"> & {
|
||||
|
||||
export const MessageThreadEmptyState = ({
|
||||
className,
|
||||
title = "No messages yet",
|
||||
description = "Start a conversation to see messages here",
|
||||
title,
|
||||
description,
|
||||
icon,
|
||||
children,
|
||||
...props
|
||||
}: MessageThreadEmptyStateProps) => (
|
||||
<div
|
||||
className={cn(
|
||||
"flex size-full flex-col items-center justify-center gap-3 p-8 text-center",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{children ?? (
|
||||
<>
|
||||
{icon && <div className="text-muted-foreground">{icon}</div>}
|
||||
<div className="space-y-1">
|
||||
<h3 className="font-medium text-sm">{title}</h3>
|
||||
{description && (
|
||||
<p className="text-muted-foreground text-sm">{description}</p>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}: MessageThreadEmptyStateProps) => {
|
||||
const t = useTranslations("Folder.chat.messageThread")
|
||||
return (
|
||||
<div
|
||||
className={cn(
|
||||
"flex size-full flex-col items-center justify-center gap-3 p-8 text-center",
|
||||
className
|
||||
)}
|
||||
{...props}
|
||||
>
|
||||
{children ?? (
|
||||
<>
|
||||
{icon && <div className="text-muted-foreground">{icon}</div>}
|
||||
<div className="space-y-1">
|
||||
<h3 className="font-medium text-sm">{title ?? t("emptyTitle")}</h3>
|
||||
{(description ?? t("emptyDescription")) && (
|
||||
<p className="text-muted-foreground text-sm">
|
||||
{description ?? t("emptyDescription")}
|
||||
</p>
|
||||
)}
|
||||
</div>
|
||||
</>
|
||||
)}
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export type MessageThreadScrollButtonProps = ComponentProps<typeof Button>
|
||||
|
||||
|
||||
@@ -323,6 +323,7 @@ export const ToolOutput = ({
|
||||
errorText,
|
||||
...props
|
||||
}: ToolOutputProps) => {
|
||||
const t = useTranslations("Folder.chat.tool")
|
||||
if (!(output || errorText)) {
|
||||
return null
|
||||
}
|
||||
@@ -348,7 +349,7 @@ export const ToolOutput = ({
|
||||
return (
|
||||
<div className={cn("space-y-2", className)} {...props}>
|
||||
<h4 className="font-medium text-muted-foreground text-xs uppercase tracking-wide">
|
||||
{errorText ? "Error" : "Result"}
|
||||
{errorText ? t("error") : t("result")}
|
||||
</h4>
|
||||
<div
|
||||
className={cn(
|
||||
|
||||
Reference in New Issue
Block a user