mirror of
https://github.com/aaronpo97/the-biergarten-app.git
synced 2026-02-16 20:13:49 +00:00
Refactor beer comment section and incorporate image carousel
Beer comment section now uses a ternary expression for isLoading. Image carousel implemented in beer by id page.
This commit is contained in:
22
components/BeerById/LoadingComponent.tsx
Normal file
22
components/BeerById/LoadingComponent.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { FC } from 'react';
|
||||
import Spinner from '../ui/Spinner';
|
||||
import CommentLoadingCardBody from './CommentLoadingCardBody';
|
||||
|
||||
interface LoadingComponentProps {
|
||||
length: number;
|
||||
}
|
||||
|
||||
const LoadingComponent: FC<LoadingComponentProps> = ({ length }) => {
|
||||
return (
|
||||
<>
|
||||
{Array.from({ length }).map((_, i) => (
|
||||
<CommentLoadingCardBody key={i} />
|
||||
))}
|
||||
<div className="p-1">
|
||||
<Spinner size="sm" />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default LoadingComponent;
|
||||
Reference in New Issue
Block a user