mirror of
https://github.com/i701/sarlink-portal.git
synced 2025-06-07 01:26:18 +00:00
All checks were successful
Build and Push Docker Images / Build and Push Docker Images (push) Successful in 7m23s
33 lines
716 B
TypeScript
33 lines
716 B
TypeScript
"use client";
|
|
|
|
import { useEffect, useState } from "react";
|
|
|
|
interface WelcomeBannerProps {
|
|
firstName?: string | null;
|
|
lastName?: string | null;
|
|
}
|
|
|
|
export function WelcomeBanner({ firstName, lastName }: WelcomeBannerProps) {
|
|
const [isVisible, setIsVisible] = useState(true);
|
|
|
|
useEffect(() => {
|
|
const timer = setTimeout(() => {
|
|
setIsVisible(false);
|
|
}, 3000);
|
|
|
|
return () => clearTimeout(timer);
|
|
}, []);
|
|
|
|
if (!isVisible) {
|
|
return null;
|
|
}
|
|
|
|
return (
|
|
<div className="text-sm font-mono px-2 p-1 fade-out-10 bg-green-500/10 text-green-900 dark:text-green-400">
|
|
Welcome,{" "}
|
|
<span className="font-semibold">
|
|
{firstName} {lastName}
|
|
</span>
|
|
</div>
|
|
);
|
|
} |