Skip to content

Commit

Permalink
fix: skelton error
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalkondle-dev committed Jun 22, 2024
1 parent b1fce64 commit 5d76974
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/(private)/notes/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import Note, { NewNote, NoteModal } from '@/components/Note';
import useFetchData from '@/hooks/useFetchData';
import { failure } from '@/lib/client_functions';
import { NoteDocument } from '@/models/Note';
import TodoSkelton from '@/components/Todo/TodoSkelton';
import Skelton from '@/components/Skelton/Skelton';

export default function NotesPage() {
const { data, loading, refetch } = useFetchData('/api/notes');
Expand Down Expand Up @@ -124,7 +124,7 @@ export default function NotesPage() {
<Container px={0} size="md">
{loading ? (
<SimpleGrid cols={{ base: 1, xs: 2, md: 3 }}>
<TodoSkelton items={6} />
<Skelton items={6} />
</SimpleGrid>
) : (
<>
Expand Down
7 changes: 7 additions & 0 deletions components/Skelton/Skelton.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import { Skeleton } from '@mantine/core';
import React from 'react';

const Skelton = ({ items = 4 }: { items?: number }) =>
[...Array(items)].map((_, i) => <Skeleton key={String(i)} height={100} mt="md" animate />);

export default Skelton;

0 comments on commit 5d76974

Please sign in to comment.