Refactor code
This commit is contained in:
@ -1,14 +1,17 @@
|
||||
"use client"
|
||||
"use client";
|
||||
|
||||
// import { PortfolioImage } from "@/generated/prisma";
|
||||
// Possibly unused: no references found in `src/app` or `src/components`.
|
||||
import { cn } from "@/lib/utils";
|
||||
import { ArtworkWithRelations } from "@/types/Artwork";
|
||||
import type { ArtworkWithRelations } from "@/types/Artwork";
|
||||
import Image from "next/image";
|
||||
import Link from "next/link";
|
||||
import { useSearchParams } from "next/navigation";
|
||||
import type { CSSProperties } from "react";
|
||||
import { useState } from "react";
|
||||
import { Button } from "../ui/button";
|
||||
|
||||
// Client-side artwork gallery with incremental pagination.
|
||||
export default function ArtworkGallery({
|
||||
initialArtworks,
|
||||
initialCursor,
|
||||
@ -52,9 +55,7 @@ export default function ArtworkGallery({
|
||||
|
||||
return (
|
||||
<div className="w-full flex flex-col gap-4">
|
||||
<div
|
||||
className="flex flex-wrap gap-4"
|
||||
>
|
||||
<div className="flex flex-wrap gap-4">
|
||||
{artworks.map((artwork) => (
|
||||
<div key={artwork.id} style={{ width: 200, height: 200 }}>
|
||||
<Link href={`/artworks/${artwork.id}`}>
|
||||
@ -66,7 +67,7 @@ export default function ArtworkGallery({
|
||||
)}
|
||||
style={{
|
||||
'--tw-border-opacity': 1,
|
||||
} as React.CSSProperties}
|
||||
} as CSSProperties}
|
||||
>
|
||||
<div
|
||||
className={cn(
|
||||
@ -96,4 +97,4 @@ export default function ArtworkGallery({
|
||||
) : null}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user