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
3 changes: 2 additions & 1 deletion app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default function RootLayout({
// visual flicker before hydration. Hence the `suppressHydrationWarning`
// prop is necessary to avoid the React hydration mismatch warning.
// https://github.com/pacocoursey/next-themes?tab=readme-ov-file#with-app
lang="en"
lang="es"
suppressHydrationWarning
>
<head>
Expand All @@ -69,6 +69,7 @@ export default function RootLayout({
dangerouslySetInnerHTML={{
__html: THEME_COLOR_SCRIPT,
}}
<html lang="es">
/>
</head>
<body className="antialiased">
Expand Down
4 changes: 2 additions & 2 deletions components/greeting.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export const Greeting = () => {
initial={{ opacity: 0, y: 10 }}
transition={{ delay: 0.5 }}
>
Hello there!
Hela, mi nombre es Victor!
</motion.div>
<motion.div
animate={{ opacity: 1, y: 0 }}
Expand All @@ -22,7 +22,7 @@ export const Greeting = () => {
initial={{ opacity: 0, y: 10 }}
transition={{ delay: 0.6 }}
>
How can I help you today?
¿en qué puedo ayudarte?
</motion.div>
</div>
);
Expand Down
16 changes: 8 additions & 8 deletions components/multimodal-input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ function PureMultimodalInput({
const { error } = await response.json();
toast.error(error);
} catch (_error) {
toast.error("Failed to upload file, please try again!");
toast.error("Error al subir imágenes pegadas, intentalo nuevamente!");
}
}, []);

Expand Down Expand Up @@ -219,7 +219,7 @@ function PureMultimodalInput({
...successfullyUploadedAttachments,
]);
} catch (error) {
console.error("Error uploading files!", error);
console.error("Error al subir imágenes pegadas!", error);
} finally {
setUploadQueue([]);
}
Expand All @@ -245,7 +245,7 @@ function PureMultimodalInput({
// Prevent default paste behavior for images
event.preventDefault();

setUploadQueue((prev) => [...prev, "Pasted image"]);
setUploadQueue((prev) => [...prev, "pegué imagen"]);

try {
const uploadPromises = imageItems
Expand All @@ -266,8 +266,8 @@ function PureMultimodalInput({
...(successfullyUploadedAttachments as Attachment[]),
]);
} catch (error) {
console.error("Error uploading pasted images:", error);
toast.error("Failed to upload pasted image(s)");
console.error("Error al subir imágenes pegadas:", error);
toast.error("Falló la subida de la imagen pegada");
} finally {
setUploadQueue([]);
}
Expand Down Expand Up @@ -311,8 +311,8 @@ function PureMultimodalInput({
className="rounded-xl border border-border bg-background p-3 shadow-xs transition-all duration-200 focus-within:border-border hover:border-muted-foreground/50"
onSubmit={(event) => {
event.preventDefault();
if (status !== "ready") {
toast.error("Please wait for the model to finish its response!");
if (status !== "listo") {
toast.error("¡Por favor, espera a que el modelo termine su respuesta!");
} else {
submitForm();
}
Expand Down Expand Up @@ -360,7 +360,7 @@ function PureMultimodalInput({
maxHeight={200}
minHeight={44}
onChange={handleInput}
placeholder="Send a message..."
placeholder="enviar mensaje..."
ref={textareaRef}
rows={1}
value={input}
Expand Down
69 changes: 34 additions & 35 deletions components/sidebar-history.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ import { LoaderIcon } from "./icons";
import { ChatItem } from "./sidebar-history-item";

type GroupedChats = {
today: Chat[];
yesterday: Chat[];
lastWeek: Chat[];
lastMonth: Chat[];
older: Chat[];
Hoy: Chat[];
Ayer: Chat[];
SemanaPasada: Chat[];
MesPasado: Chat[];
TiempoAtras: Chat[];
};

export type ChatHistory = {
Expand All @@ -53,25 +53,25 @@ const groupChatsByDate = (chats: Chat[]): GroupedChats => {
const chatDate = new Date(chat.createdAt);

if (isToday(chatDate)) {
groups.today.push(chat);
groups.Hoy.push(chat);
} else if (isYesterday(chatDate)) {
groups.yesterday.push(chat);
groups.Ayer.push(chat);
} else if (chatDate > oneWeekAgo) {
groups.lastWeek.push(chat);
groups.SemanaPasada.push(chat);
} else if (chatDate > oneMonthAgo) {
groups.lastMonth.push(chat);
groups.MesPasadp.push(chat);
} else {
groups.older.push(chat);
groups.TiempoAtras.push(chat);
}

return groups;
},
{
today: [],
yesterday: [],
lastWeek: [],
lastMonth: [],
older: [],
Hoy: [],
Ayer: [],
SemanaPasada: [],
MesPasado: [],
TiempoAtras: [],
} as GroupedChats
);
};
Expand Down Expand Up @@ -140,9 +140,9 @@ export function SidebarHistory({ user }: { user: User | undefined }) {
}
});

return "Chat deleted successfully";
return "Borrado";
},
error: "Failed to delete chat",
error: "No se borro",
});

setShowDeleteDialog(false);
Expand Down Expand Up @@ -198,7 +198,7 @@ export function SidebarHistory({ user }: { user: User | undefined }) {
<SidebarGroup>
<SidebarGroupContent>
<div className="flex w-full flex-row items-center justify-center gap-2 px-2 text-sm text-zinc-500">
Your conversations will appear here once you start chatting!
¡Tus conversaciones aparecerán aquí una vez que comiences a chatear!
</div>
</SidebarGroupContent>
</SidebarGroup>
Expand All @@ -220,12 +220,12 @@ export function SidebarHistory({ user }: { user: User | undefined }) {

return (
<div className="flex flex-col gap-6">
{groupedChats.today.length > 0 && (
{groupedChats.Hoy.length > 0 && (
<div>
<div className="px-2 py-1 text-sidebar-foreground/50 text-xs">
Today
Hoy
</div>
{groupedChats.today.map((chat) => (
{groupedChats.Hoy.map((chat) => (
<ChatItem
chat={chat}
isActive={chat.id === id}
Expand All @@ -240,12 +240,12 @@ export function SidebarHistory({ user }: { user: User | undefined }) {
</div>
)}

{groupedChats.yesterday.length > 0 && (
{groupedChats.Ayer.length > 0 && (
<div>
<div className="px-2 py-1 text-sidebar-foreground/50 text-xs">
Yesterday
Ayer
</div>
{groupedChats.yesterday.map((chat) => (
{groupedChats.Ayer.map((chat) => (
<ChatItem
chat={chat}
isActive={chat.id === id}
Expand All @@ -260,12 +260,12 @@ export function SidebarHistory({ user }: { user: User | undefined }) {
</div>
)}

{groupedChats.lastWeek.length > 0 && (
{groupedChats.SemanaPasada.length > 0 && (
<div>
<div className="px-2 py-1 text-sidebar-foreground/50 text-xs">
Last 7 days
Ultimo 7 dias
</div>
{groupedChats.lastWeek.map((chat) => (
{groupedChats.SemanaPasada.map((chat) => (
<ChatItem
chat={chat}
isActive={chat.id === id}
Expand All @@ -280,12 +280,12 @@ export function SidebarHistory({ user }: { user: User | undefined }) {
</div>
)}

{groupedChats.lastMonth.length > 0 && (
{groupedChats.SemanaPasada.length > 0 && (
<div>
<div className="px-2 py-1 text-sidebar-foreground/50 text-xs">
Last 30 days
</div>
{groupedChats.lastMonth.map((chat) => (
{groupedChats.SemanaPasada.map((chat) => (
<ChatItem
chat={chat}
isActive={chat.id === id}
Expand All @@ -300,12 +300,12 @@ export function SidebarHistory({ user }: { user: User | undefined }) {
</div>
)}

{groupedChats.older.length > 0 && (
{groupedChats.TiempAtras.length > 0 && (
<div>
<div className="px-2 py-1 text-sidebar-foreground/50 text-xs">
Older than last month
</div>
{groupedChats.older.map((chat) => (
{groupedChats.TiempAtras.map((chat) => (
<ChatItem
chat={chat}
isActive={chat.id === id}
Expand Down Expand Up @@ -334,7 +334,7 @@ export function SidebarHistory({ user }: { user: User | undefined }) {

{hasReachedEnd ? (
<div className="mt-8 flex w-full flex-row items-center justify-center gap-2 px-2 text-sm text-zinc-500">
You have reached the end of your chat history.
Final de conversaciones.
</div>
) : (
<div className="mt-8 flex flex-row items-center gap-2 p-2 text-zinc-500 dark:text-zinc-400">
Expand All @@ -350,10 +350,9 @@ export function SidebarHistory({ user }: { user: User | undefined }) {
<AlertDialog onOpenChange={setShowDeleteDialog} open={showDeleteDialog}>
<AlertDialogContent>
<AlertDialogHeader>
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
<AlertDialogTitle>¿Estás absolutamente seguro?</AlertDialogTitle>
<AlertDialogDescription>
This action cannot be undone. This will permanently delete your
chat and remove it from our servers.
Esta acción no puede deshacerse. Esto eliminará permanentemente tu chat y lo removerá de nuestros servidores.
</AlertDialogDescription>
</AlertDialogHeader>
<AlertDialogFooter>
Expand Down
4 changes: 2 additions & 2 deletions components/sidebar-user-nav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ export function SidebarUserNav({ user }: { user: User }) {
toast({
type: "error",
description:
"Checking authentication status, please try again!",
"Verificando el estado de autenticación, ¡por favor, inténtalo de nuevo!",
});

return;
Expand All @@ -104,7 +104,7 @@ export function SidebarUserNav({ user }: { user: User }) {
}}
type="button"
>
{isGuest ? "Login to your account" : "Sign out"}
{isGuest ? "Inicia sesión en tu cuenta y Cerrar sesión"}
</button>
</DropdownMenuItem>
</DropdownMenuContent>
Expand Down
2 changes: 1 addition & 1 deletion components/submit-button.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ export function SubmitButton({
)}

<output aria-live="polite" className="sr-only">
{pending || isSuccessful ? "Loading" : "Submit form"}
{pending || isSuccessful ? "Cargando" : "Enviar"}
</output>
</Button>
);
Expand Down
8 changes: 4 additions & 4 deletions components/suggested-actions.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ type SuggestedActionsProps = {

function PureSuggestedActions({ chatId, sendMessage }: SuggestedActionsProps) {
const suggestedActions = [
"What are the advantages of using Next.js?",
"Write code to demonstrate Dijkstra's algorithm",
"Help me write an essay about Silicon Valley",
"What is the weather in San Francisco?",
"¿Cuáles son las ventajas de usar Mi Agente X?",
"¿Donde puedo aplicar para una visa de tranbajo el los EEUU",
"Ayudame a solicitar empleo en el area donde vivo",
"¿Cuál es el clima en Sarasota, FL?,
];

return (
Expand Down