fixed usestate callback errors

This commit is contained in:
Polaris
2024-08-27 17:07:44 -04:00
parent d5d62572ba
commit a18e50d990
4 changed files with 71 additions and 45 deletions

View File

@ -30,17 +30,23 @@ export const columns: ColumnDef<chunithm>[] = [
};
return (
<div className="flex w-[300px] items-center truncate font-medium">
{jacketPath ? (
<img
src={`/jacketArts/${jacketPath}`}
alt="Jacket"
className={`mr-2 inline-block h-[70px] w-[70px] ${
isLoading ? "hidden" : ""
}`}
onLoad={handleImageLoad}
onError={handleImageError}
/>
) : (
{jacketPath && (
<>
<img
src={`/jacketArts/${jacketPath}`}
alt="Jacket"
className={`mr-2 inline-block h-[70px] w-[70px] ${
isLoading ? "hidden" : ""
}`}
onLoad={handleImageLoad}
onError={handleImageError}
/>
{isLoading && (
<Skeleton className="mr-2 inline-block h-[70px] w-[70px]" />
)}
</>
)}
{!jacketPath && (
<Skeleton className="mr-2 inline-block h-[70px] w-[70px]" />
)}
<span className="truncate">{row.original.title}</span>