Files
profi-frontend/src/components/LoadingList.tsx
2025-06-02 17:30:35 +03:00

12 lines
373 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import {UniqueItem} from "../types/common.ts";
export function LoadingList({data, listElement}: {data: UniqueItem[]|null, listElement(e:UniqueItem, i:number):unknown}) {
if (data === null){
return <div className={"loading"}>Идёт загрузка...</div>
}
return (
<>
{data.map((e, i) => listElement(e, i))}
</>
)
}