Skip to content

Commit

Permalink
fixed lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
aliirz committed Dec 3, 2024
1 parent f2450e0 commit 6ea8d83
Show file tree
Hide file tree
Showing 26 changed files with 188 additions and 183 deletions.
16 changes: 8 additions & 8 deletions app/about/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ import { ExternalLink } from "lucide-react"

export default function AboutPage() {
return (
<div className="container mx-auto py-8 space-y-8">
<div className="container mx-auto space-y-8 py-8">
{/* Hero Section */}
<div className="relative h-[400px] rounded-lg overflow-hidden">
<div className="relative h-[400px] overflow-hidden rounded-lg">
<div className="absolute inset-0">
<img
src="parliament.jpg"
alt="Pakistan Parliament"
className="w-full h-full object-cover"
className="size-full object-cover"
/>
<div className="absolute inset-0 bg-gradient-to-b from-black/70 via-black/50 to-black/70" />
</div>
<div className="relative z-10 h-full flex flex-col items-center justify-center text-white p-6 text-center">
<h1 className="scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl mb-4">
<div className="relative z-10 flex h-full flex-col items-center justify-center p-6 text-center text-white">
<h1 className="mb-4 scroll-m-20 text-4xl font-extrabold tracking-tight lg:text-5xl">
Meet Numainda
</h1>
<p className="text-xl text-white/80">
Expand Down Expand Up @@ -69,11 +69,11 @@ export default function AboutPage() {
<CardHeader>
<CardTitle>Our Story in the Media</CardTitle>
</CardHeader>
<CardContent className="flex flex-col md:flex-row gap-6 items-center">
<CardContent className="flex flex-col items-center gap-6 md:flex-row">
<img
src="https://codeforpakistan.org/sites/default/files/cfp_logotype_h.png"
alt="Code for Pakistan Logo"
className="w-24 h-24 object-contain"
className="size-24 object-contain"
/>
<div className="space-y-4">
<h3 className="text-2xl font-semibold">Say Hello to My New Friend</h3>
Expand All @@ -89,7 +89,7 @@ export default function AboutPage() {
className="flex items-center gap-2"
>
Read on Code for Pakistan
<ExternalLink className="h-4 w-4" />
<ExternalLink className="size-4" />
</a>
</Button>
</div>
Expand Down
4 changes: 2 additions & 2 deletions app/admin/upload/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ export default function UploadPage() {
if (!isAuthorized) {
return (
<div className="container max-w-md py-8">
<h1 className="text-2xl font-bold mb-8">Admin Access</h1>
<h1 className="mb-8 text-2xl font-bold">Admin Access</h1>
<div className="space-y-4">
<div className="space-y-2">
<Label htmlFor="password">Password</Label>
Expand Down Expand Up @@ -83,7 +83,7 @@ export default function UploadPage() {

return (
<div className="container max-w-2xl py-8">
<h1 className="text-2xl font-bold mb-8">Upload Document</h1>
<h1 className="mb-8 text-2xl font-bold">Upload Document</h1>

<form onSubmit={handleSubmit} className="space-y-6">
<div className="space-y-2">
Expand Down
4 changes: 2 additions & 2 deletions app/auth/callback/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ export default function AuthCallback() {

if (isProcessing) {
return (
<div className="min-h-screen flex items-center justify-center">
<div className="flex min-h-screen items-center justify-center">
<div className="text-center">
<div className="animate-spin rounded-full h-12 w-12 border-b-2 border-gray-900 mx-auto mb-4"></div>
<div className="mx-auto mb-4 size-12 animate-spin rounded-full border-b-2 border-gray-900"></div>
<p className="text-gray-600">Processing your login...</p>
</div>
</div>
Expand Down
34 changes: 17 additions & 17 deletions app/chat/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -172,34 +172,34 @@ export default function ChatPage() {
}

return (
<div className="flex flex-col lg:flex-row w-full h-screen overflow-hidden touch-manipulation">
<div className="flex h-screen w-full touch-manipulation flex-col overflow-hidden lg:flex-row">
<MessageThreadsSidebar
isOpen={isSidebarOpen}
onClose={() => setIsSidebarOpen(false)}
/>

<div className="flex-1 flex flex-col min-h-0">
<div className="flex min-h-0 flex-1 flex-col">
{/* Header */}
<div className="flex-none sticky top-0 z-10 bg-background h-14 border-b flex items-center justify-between px-4">
<div className="sticky top-0 z-10 flex h-14 flex-none items-center justify-between border-b bg-background px-4">
<div className="flex items-center">
<Button
variant="ghost"
size="icon"
onClick={() => setIsSidebarOpen(true)}
className="lg:hidden mr-2"
className="mr-2 lg:hidden"
>
<Menu className="h-5 w-5" />
<Menu className="size-5" />
</Button>
<MessageSquare className="h-5 w-5 mr-2" />
<MessageSquare className="mr-2 size-5" />
<span className="font-semibold">Numainda Chat</span>
</div>


</div>

{/* Messages container */}
<div className="flex-1 min-h-0 overflow-y-auto">
<div className="flex flex-col max-w-2xl mx-auto p-4">
<div className="min-h-0 flex-1 overflow-y-auto">
<div className="mx-auto flex max-w-2xl flex-col p-4">
{isClient && messages.map((message) => (
<ChatBubble
key={message.id}
Expand All @@ -209,14 +209,14 @@ export default function ChatPage() {
<ChatBubbleAvatar
className={
message.role === "assistant"
? "bg-primary/10 border border-primary/20"
? "border border-primary/20 bg-primary/10"
: "bg-muted"
}
fallback={
message.role === "assistant" ? (
<Bot className="h-4 w-4" />
<Bot className="size-4" />
) : (
<User className="h-4 w-4" />
<User className="size-4" />
)
}
/>
Expand All @@ -235,7 +235,7 @@ export default function ChatPage() {
size="icon"
onClick={() => copyToClipboard(message.content)}
>
<CopyIcon className="h-4 w-4" />
<CopyIcon className="size-4" />
<span className="sr-only">Copy message</span>
</Button>
} />
Expand All @@ -245,12 +245,12 @@ export default function ChatPage() {
{isGenerating && isClient && (
<ChatBubble variant="received" className="mb-6">
<ChatBubbleAvatar
className="bg-primary/10 border border-primary/20"
fallback={<Bot className="h-4 w-4" />}
className="border border-primary/20 bg-primary/10"
fallback={<Bot className="size-4" />}
/>
<ChatBubbleMessage>
<div className="flex items-center gap-2">
<Loader2 className="h-4 w-4 animate-spin" />
<Loader2 className="size-4 animate-spin" />
<span className="text-sm">Numainda is thinking...</span>
</div>
</ChatBubbleMessage>
Expand All @@ -262,7 +262,7 @@ export default function ChatPage() {

{/* Input - now will stay fixed at bottom */}
<div className="flex-none border-t bg-background p-4">
<div className="max-w-2xl mx-auto">
<div className="mx-auto max-w-2xl">
<form
className="flex items-center gap-2"
onSubmit={(e) => {
Expand All @@ -276,7 +276,7 @@ export default function ChatPage() {
value={input}
onChange={handleInputChange}
placeholder="Message Numainda..."
className="w-full rounded-lg border px-3 py-2 text-base bg-slate-500/10"
className="w-full rounded-lg border bg-slate-500/10 px-3 py-2 text-base"
style={{ fontSize: "16px" }}
onKeyDown={(e) => {
if (e.key === "Enter" && !e.shiftKey) {
Expand Down
32 changes: 16 additions & 16 deletions app/components/message-threads-sidebar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,24 +103,24 @@ export function MessageThreadsSidebar({ isOpen, onClose }: MessageThreadsSidebar
<>
{isOpen && (
<div
className="fixed inset-0 bg-background/80 backdrop-blur-sm z-40 lg:hidden"
className="fixed inset-0 z-40 bg-background/80 backdrop-blur-sm lg:hidden"
onClick={onClose}
/>
)}

<aside
className={cn(
"fixed inset-y-0 left-0 z-50 w-80 bg-background border-r",
"transform transition-transform duration-200 ease-in-out lg:transform-none",
"fixed inset-y-0 left-0 z-50 w-80 border-r bg-background",
"transition-transform duration-200 ease-in-out lg:transform-none",
"lg:relative lg:block",
isOpen ? "translate-x-0" : "-translate-x-full"
)}
>
<div className="flex h-full flex-col">
<div className="h-14 border-b flex items-center justify-between px-4">
<div className="flex h-14 items-center justify-between border-b px-4">
<span className="font-semibold">Chats</span>
<Button variant="ghost" size="icon" onClick={onClose} className="lg:hidden">
<X className="h-4 w-4" />
<X className="size-4" />
</Button>
</div>

Expand All @@ -129,51 +129,51 @@ export function MessageThreadsSidebar({ isOpen, onClose }: MessageThreadsSidebar
<div className="flex-1 overflow-y-auto p-2">
<Button
variant="outline"
className="w-full mb-4"
className="mb-4 w-full"
onClick={() => router.push('/chat')}
>
<Plus className="h-4 w-4 mr-2" />
<Plus className="mr-2 size-4" />
New Chat
</Button>

{threads.map((thread) => (
<Button
key={thread.id}
variant="ghost"
className="w-full justify-start text-left h-auto py-3 px-3 mb-1 group"
className="group mb-1 h-auto w-full justify-start p-3 text-left"
onClick={() => {
router.push(`/chat?thread=${thread.id}`)
onClose?.()
}}
>
<MessageCircle className="h-4 w-4 mr-3 shrink-0" />
<MessageCircle className="mr-3 size-4 shrink-0" />
<div className="flex-1 overflow-hidden">
<div className="font-medium truncate">{thread.title}</div>
<div className="text-xs text-muted-foreground truncate">
<div className="truncate font-medium">{thread.title}</div>
<div className="truncate text-xs text-muted-foreground">
{thread.messages[thread.messages.length - 1]?.content.slice(0, 50) || 'New chat'}...
</div>
</div>
<Button
variant="ghost"
size="icon"
className="opacity-0 group-hover:opacity-100 transition-opacity"
className="opacity-0 transition-opacity group-hover:opacity-100"
onClick={(e) => handleDeleteThread(thread.id, e)}
>
<Trash2 className="h-4 w-4 text-muted-foreground hover:text-destructive" />
<Trash2 className="size-4 text-muted-foreground hover:text-destructive" />
</Button>
</Button>
))}
</div>

<div className="p-4 border-t">
<div className="border-t p-4">
<Button className="w-full">
<Plus className="h-4 w-4 mr-2" />
<Plus className="mr-2 size-4" />
New Chat
</Button>
</div>
</>
) : (
<div className="flex-1 flex items-center justify-center p-4">
<div className="flex flex-1 items-center justify-center p-4">
<PehchanLoginButton />
</div>
)}
Expand Down
26 changes: 13 additions & 13 deletions app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,28 +7,28 @@ import { Book, LucideBook, LandmarkIcon, MessageSquare, Info, ScaleIcon } from '
export default function IndexPage() {
return (
<section className="container grid items-center gap-6 pb-8 pt-6 md:py-10">
<div className="relative h-[400px] sm:h-[300px] rounded-lg overflow-hidden mb-8">
<div className="relative mb-8 h-[400px] overflow-hidden rounded-lg sm:h-[300px]">
<div className="absolute inset-0">
<img
src="SC-b6-1.jpg"
alt="Supreme Court of Pakistan"
className="w-full h-full object-cover"
className="size-full object-cover"
/>
<div className="absolute inset-0 bg-gradient-to-r from-background/90 via-background/50 to-background/90" />
</div>
<div className="relative z-10 h-full flex max-w-[980px] flex-col justify-center p-4 sm:p-6">
<h1 className="text-2xl sm:text-3xl font-extrabold leading-tight tracking-tighter md:text-4xl">
<div className="relative z-10 flex h-full max-w-[980px] flex-col justify-center p-4 sm:p-6">
<h1 className="text-2xl font-extrabold leading-tight tracking-tighter sm:text-3xl md:text-4xl">
Welcome to Numainda <br className="hidden sm:inline" />
Your Guide to Pakistan&apos;s Constitution and Laws
</h1>
<p className="max-w-[700px] text-base sm:text-lg text-muted-foreground mt-4">
<p className="mt-4 max-w-[700px] text-base text-muted-foreground sm:text-lg">
Explore Pakistan&apos;s rich legal and parliamentary heritage with our AI-powered chatbot.
Gain insights into the constitution, election laws, and parliamentary bulletins.
</p>
</div>
</div>

<div className="flex flex-col sm:flex-row gap-4">
<div className="flex flex-col gap-4 sm:flex-row">
<Link
href="/chat"
className={buttonVariants({
Expand All @@ -37,7 +37,7 @@ export default function IndexPage() {
className: "w-full sm:w-auto"
})}
>
<MessageSquare className="mr-2 h-6 w-6" />
<MessageSquare className="mr-2 size-6" />
Start Chatting
</Link>
<Link
Expand All @@ -48,7 +48,7 @@ export default function IndexPage() {
className: "w-full sm:w-auto"
})}
>
<Info className="mr-2 h-6 w-6" />
<Info className="mr-2 size-6" />
Learn More
</Link>
</div>
Expand All @@ -57,7 +57,7 @@ export default function IndexPage() {
<Card>
<CardHeader>
<CardTitle className="flex items-center">
<Book className="mr-2 h-5 w-5" />
<Book className="mr-2 size-5" />
Explore the Constitution
</CardTitle>
</CardHeader>
Expand All @@ -68,7 +68,7 @@ export default function IndexPage() {
<Card>
<CardHeader>
<CardTitle className="flex items-center">
<ScaleIcon className="mr-2 h-5 w-5" />
<ScaleIcon className="mr-2 size-5" />
Election Laws Demystified
</CardTitle>
</CardHeader>
Expand All @@ -79,7 +79,7 @@ export default function IndexPage() {
<Card>
<CardHeader>
<CardTitle className="flex items-center">
<LandmarkIcon className="mr-2 h-5 w-5" />
<LandmarkIcon className="mr-2 size-5" />
Parliamentary Insights
</CardTitle>
</CardHeader>
Expand All @@ -90,8 +90,8 @@ export default function IndexPage() {
</div>

<div className="mt-8">
<h2 className="text-2xl font-bold mb-4 flex items-center">
<Info className="mr-2 h-6 w-6" />
<h2 className="mb-4 flex items-center text-2xl font-bold">
<Info className="mr-2 size-6" />
Why We Built Numainda
</h2>
<p className="text-muted-foreground">
Expand Down
8 changes: 4 additions & 4 deletions app/proceedings/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,17 @@ export default async function ProceedingPage({

return (
<div className="container mx-auto py-8">
<div className="max-w-3xl mx-auto">
<Link href="/proceedings" className="flex items-center gap-2 mb-6">
<div className="mx-auto max-w-3xl">
<Link href="/proceedings" className="mb-6 flex items-center gap-2">
<ArrowLeft className="size-4" />
</Link>
<div className="mb-6">
<h1 className="text-3xl font-bold mb-2">{proceeding.title}</h1>
<h1 className="mb-2 text-3xl font-bold">{proceeding.title}</h1>
<p>{format(new Date(proceeding.date), 'MMMM d, yyyy')}</p>
</div>

<div className="prose max-w-none">
<h2 className="text-xl font-semibold mb-4">Summary</h2>
<h2 className="mb-4 text-xl font-semibold">Summary</h2>
<ReactMarkdown>{proceeding.summary}</ReactMarkdown>
</div>
</div>
Expand Down
Loading

0 comments on commit 6ea8d83

Please sign in to comment.