nextjs-hackathon-stack 0.1.7 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nextjs-hackathon-stack",
3
- "version": "0.1.7",
3
+ "version": "0.1.8",
4
4
  "description": "Scaffold a full-stack Next.js hackathon starter",
5
5
  "type": "module",
6
6
  "bin": {
@@ -0,0 +1,28 @@
1
+ "use client";
2
+
3
+ import { useEffect } from "react";
4
+
5
+ export default function Error({
6
+ error,
7
+ reset,
8
+ }: {
9
+ error: Error & { digest?: string };
10
+ reset: () => void;
11
+ }) {
12
+ useEffect(() => {
13
+ console.error(error);
14
+ }, [error]);
15
+
16
+ return (
17
+ <div className="flex min-h-screen flex-col items-center justify-center gap-4">
18
+ <h2 className="text-xl font-semibold">Something went wrong</h2>
19
+ <p className="text-muted-foreground text-sm">{error.message}</p>
20
+ <button
21
+ onClick={reset}
22
+ className="rounded bg-primary px-4 py-2 text-primary-foreground"
23
+ >
24
+ Try again
25
+ </button>
26
+ </div>
27
+ );
28
+ }
@@ -4,7 +4,7 @@ import { useChat } from "@ai-sdk/react";
4
4
 
5
5
  export function ChatUi() {
6
6
  const { messages, input, handleInputChange, handleSubmit, status } = useChat({
7
- api: "/features/chat/api",
7
+ api: "/api/chat",
8
8
  });
9
9
  const isLoading = status === "streaming" || status === "submitted";
10
10