Skip to content

Commit 86a13ec

Browse files
committed
Update SharedCaps.tsx
1 parent 734029f commit 86a13ec

File tree

1 file changed

+32
-26
lines changed

1 file changed

+32
-26
lines changed

apps/web/app/(org)/dashboard/spaces/[spaceId]/SharedCaps.tsx

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -281,32 +281,38 @@ export const SharedCaps = ({
281281
</>
282282
)}
283283

284-
<h1 className="mb-4 text-2xl font-medium text-gray-12">Videos</h1>
285-
<div className="grid grid-cols-1 gap-4 sm:gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
286-
{data.map((cap) => {
287-
const isOwner = cap.ownerId === currentUserId;
288-
return (
289-
<SharedCapCard
290-
key={cap.id}
291-
cap={cap}
292-
hideSharedStatus
293-
isLoadingAnalytics={isLoadingAnalytics}
294-
analytics={analytics[cap.id] || 0}
295-
organizationName={activeOrganization?.organization.name || ""}
296-
spaceName={spaceData?.name || ""}
297-
userId={currentUserId}
298-
onDragStart={() =>
299-
setIsDraggingCap({ isOwner, isDragging: true })
300-
}
301-
onDragEnd={() => setIsDraggingCap({ isOwner, isDragging: false })}
302-
/>
303-
);
304-
})}
305-
</div>
306-
{(data.length > limit || data.length === limit || page !== 1) && (
307-
<div className="mt-4">
308-
<CapPagination currentPage={page} totalPages={totalPages} />
309-
</div>
284+
{data.length > 0 && (
285+
<>
286+
<h1 className="mb-4 text-2xl font-medium text-gray-12">Videos</h1>
287+
<div className="grid grid-cols-1 gap-4 sm:gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 2xl:grid-cols-5">
288+
{data.map((cap) => {
289+
const isOwner = cap.ownerId === currentUserId;
290+
return (
291+
<SharedCapCard
292+
key={cap.id}
293+
cap={cap}
294+
hideSharedStatus
295+
isLoadingAnalytics={isLoadingAnalytics}
296+
analytics={analytics[cap.id] || 0}
297+
organizationName={activeOrganization?.organization.name || ""}
298+
spaceName={spaceData?.name || ""}
299+
userId={currentUserId}
300+
onDragStart={() =>
301+
setIsDraggingCap({ isOwner, isDragging: true })
302+
}
303+
onDragEnd={() =>
304+
setIsDraggingCap({ isOwner, isDragging: false })
305+
}
306+
/>
307+
);
308+
})}
309+
</div>
310+
{(data.length > limit || data.length === limit || page !== 1) && (
311+
<div className="mt-4">
312+
<CapPagination currentPage={page} totalPages={totalPages} />
313+
</div>
314+
)}
315+
</>
310316
)}
311317
</div>
312318
);

0 commit comments

Comments
 (0)