This commit is contained in:
parent
e9dc494268
commit
34d4696cc5
|
|
@ -241,7 +241,7 @@ export const ChatInput: FC<ChatInputProps> = ({}) => {
|
||||||
className="ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring text-md flex w-full resize-none rounded-md border-none bg-transparent px-14 py-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50"
|
className="ring-offset-background placeholder:text-muted-foreground focus-visible:ring-ring text-md flex w-full resize-none rounded-md border-none bg-transparent px-14 py-2 focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50"
|
||||||
placeholder={t(
|
placeholder={t(
|
||||||
// `Ask anything. Type "@" for assistants, "/" for prompts, "#" for files, and "!" for tools.`
|
// `Ask anything. Type "@" for assistants, "/" for prompts, "#" for files, and "!" for tools.`
|
||||||
`Ask anything. Type @ / # !`
|
"inputPlaceholder"
|
||||||
)}
|
)}
|
||||||
onValueChange={handleInputChange}
|
onValueChange={handleInputChange}
|
||||||
value={userInput}
|
value={userInput}
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ import { ChangeEvent, FC, useState } from "react"
|
||||||
import { toast } from "sonner"
|
import { toast } from "sonner"
|
||||||
import { Input } from "./input"
|
import { Input } from "./input"
|
||||||
|
|
||||||
|
import { useTranslation } from "react-i18next"
|
||||||
|
|
||||||
interface ImagePickerProps {
|
interface ImagePickerProps {
|
||||||
src: string
|
src: string
|
||||||
image: File | null
|
image: File | null
|
||||||
|
|
@ -20,6 +22,8 @@ const ImagePicker: FC<ImagePickerProps> = ({
|
||||||
width = 200,
|
width = 200,
|
||||||
height = 200
|
height = 200
|
||||||
}) => {
|
}) => {
|
||||||
|
const { t } = useTranslation()
|
||||||
|
|
||||||
const [previewSrc, setPreviewSrc] = useState<string>(src)
|
const [previewSrc, setPreviewSrc] = useState<string>(src)
|
||||||
const [previewImage, setPreviewImage] = useState<File | null>(image)
|
const [previewImage, setPreviewImage] = useState<File | null>(image)
|
||||||
|
|
||||||
|
|
@ -28,7 +32,7 @@ const ImagePicker: FC<ImagePickerProps> = ({
|
||||||
const file = e.target.files[0]
|
const file = e.target.files[0]
|
||||||
|
|
||||||
if (file.size > 6000000) {
|
if (file.size > 6000000) {
|
||||||
toast.error("Image must be less than 6MB!")
|
toast.error(t("side.imageTooLarge"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -42,7 +46,7 @@ const ImagePicker: FC<ImagePickerProps> = ({
|
||||||
const ctx = canvas.getContext("2d")
|
const ctx = canvas.getContext("2d")
|
||||||
|
|
||||||
if (!ctx) {
|
if (!ctx) {
|
||||||
toast.error("Unable to create canvas context.")
|
toast.error(t("side.canvasError"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"Ask anything. Type \"/\" for prompts, \"@\" for files, and \"#\" for tools.": "Ask anything. Type \"/\" for prompts, \"@\" for files, and \"#\" for tools.",
|
"inputPlaceholder": "Ask anything. Type \"/\" for prompts, \"@\" for files, and \"#\" for tools.",
|
||||||
"Company Name": "Jelly Drops LLC",
|
"Company Name": "Jelly Drops LLC",
|
||||||
"Clock In": "Clock In",
|
"Clock In": "Clock In",
|
||||||
|
|
||||||
|
|
@ -13,12 +13,6 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"login": {
|
"login": {
|
||||||
"chatTime": {
|
|
||||||
"Today": "Today",
|
|
||||||
"Yesterday": "Yesterday",
|
|
||||||
"PreviousWeek": "Previous Week",
|
|
||||||
"Older": "Older"
|
|
||||||
},
|
|
||||||
"email": "Email",
|
"email": "Email",
|
||||||
"emailPlaceholder": "you@example.com",
|
"emailPlaceholder": "you@example.com",
|
||||||
"password": "Password",
|
"password": "Password",
|
||||||
|
|
@ -134,6 +128,12 @@
|
||||||
},
|
},
|
||||||
|
|
||||||
"side": {
|
"side": {
|
||||||
|
"chatTime": {
|
||||||
|
"Today": "Today",
|
||||||
|
"Yesterday": "Yesterday",
|
||||||
|
"PreviousWeek": "Previous Week",
|
||||||
|
"Older": "Older"
|
||||||
|
},
|
||||||
"selectWorkspace": "Select workspace...",
|
"selectWorkspace": "Select workspace...",
|
||||||
"newWorkspace": "New Workspace",
|
"newWorkspace": "New Workspace",
|
||||||
"searchWorkspaces": "Search workspaces...",
|
"searchWorkspaces": "Search workspaces...",
|
||||||
|
|
@ -209,7 +209,9 @@
|
||||||
"toolDescriptionPlaceholder": "Tool description...",
|
"toolDescriptionPlaceholder": "Tool description...",
|
||||||
"customHeadersLabel": "Custom Headers",
|
"customHeadersLabel": "Custom Headers",
|
||||||
"schemaLabel": "Schema",
|
"schemaLabel": "Schema",
|
||||||
"dropFileHere": "Drop file here"
|
"dropFileHere": "Drop file here",
|
||||||
|
"imageTooLarge": "Image must be less than 6MB!",
|
||||||
|
"canvasError": "Unable to create canvas context."
|
||||||
},
|
},
|
||||||
|
|
||||||
"contentType": {
|
"contentType": {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"Ask anything. Type \"/\" for prompts, \"@\" for files, and \"#\" for tools.": "何でも聞いてください。「/」でプロンプト、「@」でファイル、「#」でツールを入力してください。",
|
"inputPlaceholder": "何でも聞いてください。「/」でプロンプト、「@」でファイル、「#」でツールを入力してください。",
|
||||||
"Company Name": "Jelly Drops LLC",
|
"Company Name": "Jelly Drops LLC",
|
||||||
"Clock In": "出勤する",
|
"Clock In": "出勤する",
|
||||||
"setup": {
|
"setup": {
|
||||||
|
|
@ -208,7 +208,9 @@
|
||||||
"toolDescriptionPlaceholder": "ツールの説明...",
|
"toolDescriptionPlaceholder": "ツールの説明...",
|
||||||
"customHeadersLabel": "カスタムヘッダー",
|
"customHeadersLabel": "カスタムヘッダー",
|
||||||
"schemaLabel": "スキーマ",
|
"schemaLabel": "スキーマ",
|
||||||
"dropFileHere": "ここにファイルをドロップ"
|
"dropFileHere": "ここにファイルをドロップ",
|
||||||
|
"imageTooLarge": "画像は6MB未満である必要があります!",
|
||||||
|
"canvasError": "キャンバスコンテキストを作成できませんでした。"
|
||||||
},
|
},
|
||||||
|
|
||||||
"contentType": {
|
"contentType": {
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
"Ask anything. Type \"/\" for prompts, \"@\" for files, and \"#\" for tools.": "随便问点什么。输入“/”查找提示,“@”查找文件,“#”查找工具。",
|
"inputPlaceholder": "随便问点什么。输入“/”查找提示,“@”查找文件,“#”查找工具。",
|
||||||
"Company Name": "深圳果冻移民咨询有限责任公司",
|
"Company Name": "深圳果冻移民咨询有限责任公司",
|
||||||
"Clock In": "打卡",
|
"Clock In": "打卡",
|
||||||
"setup": {
|
"setup": {
|
||||||
|
|
@ -208,7 +208,9 @@
|
||||||
"toolDescriptionPlaceholder": "工具描述...",
|
"toolDescriptionPlaceholder": "工具描述...",
|
||||||
"customHeadersLabel": "自定义请求头",
|
"customHeadersLabel": "自定义请求头",
|
||||||
"schemaLabel": "Schema",
|
"schemaLabel": "Schema",
|
||||||
"dropFileHere": "将文件拖放到此处"
|
"dropFileHere": "将文件拖放到此处",
|
||||||
|
"imageTooLarge": "图片必须小于6MB!",
|
||||||
|
"canvasError": "无法创建画布上下文。"
|
||||||
},
|
},
|
||||||
|
|
||||||
"contentType": {
|
"contentType": {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue