Skip to content

Commit 70d479f

Browse files
committed
feat: placeholder image for data views
1 parent ca051e5 commit 70d479f

File tree

1 file changed

+13
-16
lines changed

1 file changed

+13
-16
lines changed

apps/web/partials/blocks/table/table-block-table.tsx

+13-16
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import * as React from 'react';
1919
import { useState } from 'react';
2020

2121
import { Filter } from '~/core/blocks-sdk/table';
22+
import { PLACEHOLDER_SPACE_IMAGE } from '~/core/constants';
2223
import { useRelations } from '~/core/database/relations';
2324
import { useTriples } from '~/core/database/triples';
2425
import { DB } from '~/core/database/write';
@@ -433,14 +434,12 @@ export const TableBlockTable = React.memo(
433434
<div key={index}>
434435
<Link href={href} className="group inline-flex items-center gap-6 pr-6">
435436
<div className="relative h-20 w-20 flex-shrink-0 overflow-clip rounded-lg bg-grey-01">
436-
{image && (
437-
<Image
438-
src={getImagePath(image)}
439-
className="object-cover transition-transform duration-150 ease-in-out group-hover:scale-105"
440-
alt=""
441-
fill
442-
/>
443-
)}
437+
<Image
438+
src={image ? getImagePath(image) : PLACEHOLDER_SPACE_IMAGE}
439+
className="object-cover transition-transform duration-150 ease-in-out group-hover:scale-105"
440+
alt=""
441+
fill
442+
/>
444443
</div>
445444
<div>
446445
<div className="flex items-center gap-2">
@@ -470,14 +469,12 @@ export const TableBlockTable = React.memo(
470469
return (
471470
<Link key={index} href={href} className="group flex flex-col gap-3">
472471
<div className="relative aspect-[2/1] w-full overflow-clip rounded-lg bg-grey-01">
473-
{image && (
474-
<Image
475-
src={getImagePath(image)}
476-
className="object-cover transition-transform duration-150 ease-in-out group-hover:scale-105"
477-
alt=""
478-
fill
479-
/>
480-
)}
472+
<Image
473+
src={image ? getImagePath(image) : PLACEHOLDER_SPACE_IMAGE}
474+
className="object-cover transition-transform duration-150 ease-in-out group-hover:scale-105"
475+
alt=""
476+
fill
477+
/>
481478
</div>
482479
<div className="flex items-center gap-2">
483480
{verified && (

0 commit comments

Comments
 (0)