Initial import of 1407 block sources under blocks/
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,78 @@
|
||||
"use client";
|
||||
|
||||
import { X } from "lucide-react";
|
||||
import { useState } from "react";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
interface Banner4Props {
|
||||
title: string;
|
||||
description: string;
|
||||
buttonText: string;
|
||||
buttonUrl: string;
|
||||
defaultVisible?: boolean;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const Banner4 = ({
|
||||
title = "فروش ویژه جمعه سیاه! 🎉",
|
||||
description = "تا ۷۰٪ تخفیف روی تمام محصولات. فرصت محدود!",
|
||||
defaultVisible = true,
|
||||
className,
|
||||
}: Banner4Props) => {
|
||||
const [isVisible, setIsVisible] = useState(defaultVisible);
|
||||
|
||||
const handleClose = () => {
|
||||
setIsVisible(false);
|
||||
};
|
||||
|
||||
if (!isVisible) return null;
|
||||
|
||||
return (
|
||||
<section
|
||||
dir="rtl"
|
||||
lang="fa"
|
||||
className={cn("w-full bg-primary p-4", className)}
|
||||
>
|
||||
<div className="container">
|
||||
<div className="relative flex flex-col gap-4 text-center md:flex-row md:items-center md:justify-center">
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="absolute top-0 end-0 h-8 w-8 md:hidden"
|
||||
aria-label="بستن"
|
||||
onClick={handleClose}
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
</Button>
|
||||
|
||||
<div className="flex flex-col items-center gap-3 pt-2 text-primary-foreground md:flex-row md:items-center md:pt-0">
|
||||
<div className="flex flex-col gap-1 md:flex-row md:items-center">
|
||||
<p className="text-sm font-medium">{title}</p>
|
||||
<p className="text-sm text-primary-foreground/80">
|
||||
{description}
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2">
|
||||
<Button
|
||||
type="button"
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="hidden h-8 w-8 invert md:inline-flex"
|
||||
aria-label="بستن"
|
||||
onClick={handleClose}
|
||||
>
|
||||
<X className="h-4 w-4" />
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
);
|
||||
};
|
||||
|
||||
export { Banner4 };
|
||||
Reference in New Issue
Block a user