Add Dockerfile, add raw view
This commit is contained in:
42
src/components/global/Banner.tsx
Normal file
42
src/components/global/Banner.tsx
Normal file
@ -0,0 +1,42 @@
|
||||
import { prisma } from "@/lib/prisma";
|
||||
import { cn } from "@/lib/utils";
|
||||
import { Pacifico } from "next/font/google";
|
||||
import Image from "next/image";
|
||||
|
||||
const pacifico = Pacifico({ weight: "400", subsets: ["latin"] });
|
||||
|
||||
export default async function Banner() {
|
||||
const headerImage = await prisma.artwork.findFirst({
|
||||
where: { setAsHeader: true },
|
||||
// include: {
|
||||
// variants: {
|
||||
// where: { type: "modified" },
|
||||
// take: 1,
|
||||
// },
|
||||
// },
|
||||
})
|
||||
|
||||
const alt = headerImage?.altText ?? "Header Image"
|
||||
const title = "Gaertan Art"
|
||||
|
||||
return (
|
||||
<div className="w-full">
|
||||
{headerImage && (
|
||||
<div className="relative w-full h-24 md:h-48 lg:h-48">
|
||||
<Image
|
||||
src={`/api/image/${headerImage.variants[0].s3Key}`}
|
||||
alt={alt}
|
||||
fill
|
||||
className="object-cover"
|
||||
priority
|
||||
/>
|
||||
<div className="absolute inset-0 bg-black/40 flex items-center justify-center text-center">
|
||||
<h1 className={cn(pacifico.className, "text-shadow text-white text-3xl md:text-5xl font-bold drop-shadow")}>
|
||||
{title}
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user