registry/default/sections/banner-2.tsx
"use client";
import { Sparkles, X } from "lucide-react";
import Link from "next/link";
import { useState } from "react";
import { Button } from "@/components/ui/button";
export default function Banner02() {
const [isClosed, setIsClosed] = useState(false);
if (isClosed) return null;
return (
<div className="w-full py-4 md:py-10">
<div className="flex w-full flex-col items-start gap-3 bg-gray-100 px-4 py-3 sm:flex-row sm:items-center sm:gap-2 sm:px-6 sm:py-2 dark:bg-violet-800">
<Sparkles className="h-5 w-5 shrink-0 text-gray-700 dark:text-white" />
<div className="min-w-0 flex-1">
<p className="text-gray-900 text-sm dark:text-white">
<span className="font-semibold">
We've just announced our Series A1.
</span>{" "}
<Link
className="text-gray-600 underline hover:text-gray-900 dark:text-gray-100 dark:hover:text-white"
href="#"
>
Read about it from our CEO.
</Link>
</p>
</div>
<div className="flex w-full items-center gap-2 sm:w-auto">
<Button className="rounded-full text-xs" size="sm">
Read update
</Button>
<Button
className="border-none text-gray-700 shadow-none hover:bg-transparent dark:text-white"
onClick={() => setIsClosed(true)}
variant="ghost"
>
<X className="h-4 w-4" />
</Button>
</div>
</div>
</div>
);
}