Initial import of 1407 block sources under blocks/
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,76 @@
|
||||
"use client";
|
||||
|
||||
import { X } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
interface Banner2Props {
|
||||
title: string;
|
||||
description: string;
|
||||
linkText: string;
|
||||
linkUrl: string;
|
||||
defaultVisible?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const Banner2 = ({
|
||||
title = "نسخه ۲۰ منتشر شد!",
|
||||
description = "جزئیات این نسخه را",
|
||||
linkText = "مشاهده کنید",
|
||||
linkUrl = "#",
|
||||
defaultVisible = true,
|
||||
className,
|
||||
}: Banner2Props) => {
|
||||
const [isVisible, setIsVisible] = useState(defaultVisible);
|
||||
|
||||
const handleClose = () => {
|
||||
setIsVisible(false);
|
||||
};
|
||||
|
||||
if (!isVisible) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
dir="rtl"
|
||||
lang="fa"
|
||||
className={cn("w-full bg-muted px-4 py-3", className)}
|
||||
>
|
||||
<div className="container">
|
||||
<div className="flex items-center gap-2">
|
||||
<div className="flex-1 text-start">
|
||||
<span className="text-sm">
|
||||
<span className="font-medium">{title}</span>{" "}
|
||||
<span className="text-muted-foreground">
|
||||
{description}{" "}
|
||||
<a
|
||||
href={linkUrl}
|
||||
className="underline underline-offset-2 hover:text-foreground"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
{linkText}
|
||||
</a>
|
||||
.
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="-ms-2 h-8 w-8 flex-none"
|
||||
aria-label="بستن"
|
||||
onClick={handleClose}
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
export { Banner2 };
|
||||
Reference in New Issue
Block a user