mirror of
https://github.com/astuto/astuto.git
synced 2025-12-16 11:47:56 +01:00
27 lines
608 B
TypeScript
27 lines
608 B
TypeScript
|
|
import * as React from 'react';
|
||
|
|
|
||
|
|
import ILike from '../../interfaces/ILike';
|
||
|
|
import Spinner from '../shared/Spinner';
|
||
|
|
import { DangerText } from '../shared/CustomTexts';
|
||
|
|
|
||
|
|
interface Props {
|
||
|
|
likes: Array<ILike>;
|
||
|
|
areLoading: boolean;
|
||
|
|
error: string;
|
||
|
|
}
|
||
|
|
|
||
|
|
const LikeList = ({ likes, areLoading, error}: Props) => (
|
||
|
|
<div className="likeList">
|
||
|
|
{ areLoading ? <Spinner /> : null }
|
||
|
|
{ error ? <DangerText>{error}</DangerText> : null }
|
||
|
|
{
|
||
|
|
likes.map((like, i) => (
|
||
|
|
<div className="like" key={i}>
|
||
|
|
{like.fullName}
|
||
|
|
</div>
|
||
|
|
))
|
||
|
|
}
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
|
||
|
|
export default LikeList;
|