initial
This commit is contained in:
13
src/components/LoadingList.tsx
Normal file
13
src/components/LoadingList.tsx
Normal file
@@ -0,0 +1,13 @@
|
||||
import {ReactElement} from "react";
|
||||
import {UniqueItem} from "../types/common.ts";
|
||||
|
||||
export function LoadingList({data, listElement}: {data: UniqueItem[]|null, listElement(e:UniqueItem, i:number):ReactElement}) {
|
||||
if (data === null){
|
||||
return <div className={"loading"}>Идёт загрузка...</div>
|
||||
}
|
||||
return (
|
||||
<>
|
||||
{data.map((e, i) => listElement(e, i))}
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user