Skip to content

Commit

Permalink
Wrap Image component in Suspense
Browse files Browse the repository at this point in the history
  • Loading branch information
albireox committed Oct 10, 2024
1 parent 919ee8d commit e9a0030
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions app/file/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

'use client';

import React from 'react';
import React, { Suspense } from 'react';
import { useSearchParams } from 'next/navigation';
import { Image } from '@mantine/core';
import getSystemFile from '@/src/actions/get-system-image';
Expand Down Expand Up @@ -50,7 +50,11 @@ export default function FilePath() {
const path = params.get('path');

if (type === 'image') {
return <ImageFile path={path} />;
return (
<Suspense fallback={<div>Loading...</div>}>
<ImageFile path={path} />;
</Suspense>
);
}

return null;
Expand Down

0 comments on commit e9a0030

Please sign in to comment.