diff --git a/components/header.tsx b/components/header.tsx
index b2ffc03..d59f67a 100644
--- a/components/header.tsx
+++ b/components/header.tsx
@@ -21,7 +21,7 @@ export async function Header() {
-
+
@@ -33,15 +33,15 @@ export async function Header() {
rel="noopener noreferrer"
className={cn(buttonVariants({ variant: 'outline' }))}
>
-
-
GitHub
+
+
GitHub
-
+
Deploy to Vercel
Deploy
diff --git a/components/login-button.tsx b/components/login-button.tsx
new file mode 100644
index 0000000..3aef62d
--- /dev/null
+++ b/components/login-button.tsx
@@ -0,0 +1,40 @@
+'use client'
+
+import * as React from 'react'
+import { signIn } from '@auth/nextjs/client'
+
+import { cn } from '@/lib/utils'
+import { Button, type ButtonProps } from '@/components/ui/button'
+import { IconGitHub, IconSpinner } from '@/components/ui/icons'
+
+interface LoginButtonProps extends ButtonProps {
+ text?: string
+}
+
+export function LoginButton({
+ className,
+ text = 'Login with GitHub',
+ ...props
+}: LoginButtonProps) {
+ const [isLoading, setIsLoading] = React.useState(false)
+
+ return (
+
+ )
+}
diff --git a/components/sidebar-list.tsx b/components/sidebar-list.tsx
index 22c405e..1e2278b 100644
--- a/components/sidebar-list.tsx
+++ b/components/sidebar-list.tsx
@@ -1,13 +1,30 @@
import { getChats } from '@/app/actions'
import { Session } from '@auth/core/types'
-import { SidebarItem } from './sidebar-item'
+
+import { SidebarItem } from '@/components/sidebar-item'
+import { LoginButton } from '@/components/login-button'
export interface SidebarListProps {
session?: Session
}
-export async function SidebarList(props: SidebarListProps) {
- const chats = await getChats(props.session?.user?.email)
+export async function SidebarList({ session }: SidebarListProps) {
+ if (!session?.user?.email) {
+ return (
+
+
+
You are not logged in!
+
+ Please login for chat history.
+
+
+
+
+ )
+ }
+
+ const chats = await getChats(session.user.email)
+
return (
{chats?.length ? (
@@ -16,7 +33,7 @@ export async function SidebarList(props: SidebarListProps) {
@@ -24,13 +41,7 @@ export async function SidebarList(props: SidebarListProps) {
) : (
-
- {props?.session?.user ? (
- <>No chat history>
- ) : (
- <>Login for history>
- )}
-
+
No chat history
)}
diff --git a/components/ui/sheet.tsx b/components/ui/sheet.tsx
index 6d12ff7..d333799 100644
--- a/components/ui/sheet.tsx
+++ b/components/ui/sheet.tsx
@@ -85,13 +85,7 @@ const SheetHeader = ({
className,
...props
}: React.HTMLAttributes