Files
livedash-node/components/WelcomeBanner.tsx
Kaj Kowalski cd05fc8648 fix: resolve Prettier markdown code block parsing errors
- Fix syntax errors in skills markdown files (.github/skills, .opencode/skills)
- Change typescript to tsx for code blocks with JSX
- Replace ellipsis (...) in array examples with valid syntax
- Separate CSS from TypeScript into distinct code blocks
- Convert JavaScript object examples to valid JSON in docs
- Fix enum definitions with proper comma separation
2026-01-20 21:09:29 +01:00

63 lines
2.1 KiB
TypeScript

"use client";
import { authClient } from "@/lib/auth/client";
interface WelcomeBannerProps {
companyName?: string;
}
export default function WelcomeBanner({ companyName }: WelcomeBannerProps) {
const { data } = authClient.useSession();
const userName = data?.user?.name || "User";
const currentTime = new Date();
const hour = currentTime.getHours();
let greeting = "Welcome";
if (hour < 12) {
greeting = "Good morning";
} else if (hour < 18) {
greeting = "Good afternoon";
} else {
greeting = "Good evening";
}
return (
<div className="bg-linear-to-r from-blue-600 to-indigo-700 text-white p-6 rounded-xl shadow-lg mb-8">
<div className="flex justify-between items-center">
<div>
<h1 className="text-3xl font-bold">
{greeting}, {userName}!
</h1>
<p className="mt-2 opacity-90">
Welcome to the {companyName || "LiveDash"} analytics dashboard.
Here&apos;s an overview of your metrics and performance data.
</p>
</div>
<div className="hidden md:block">
<div className="text-5xl">📊</div>
</div>
</div>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4 mt-6">
<div className="bg-white/20 backdrop-blur-sm p-4 rounded-lg">
<div className="text-sm opacity-75">Last Update</div>
<div className="text-xl font-semibold">
{currentTime.toLocaleString()}
</div>
</div>
<div className="bg-white/20 backdrop-blur-sm p-4 rounded-lg">
<div className="text-sm opacity-75">Current Status</div>
<div className="text-xl font-semibold flex items-center">
<span className="inline-block w-2 h-2 bg-green-400 rounded-full mr-2" />
All Systems Operational
</div>
</div>
<div className="bg-white/20 backdrop-blur-sm p-4 rounded-lg">
<div className="text-sm opacity-75">Today&apos;s Insights</div>
<div className="text-xl font-semibold">Ready to Explore</div>
</div>
</div>
</div>
);
}