James cb977636f7 add loading animation
Signed-off-by: James <james@jan.ai>
2023-10-12 07:30:29 -07:00

29 lines
791 B
TypeScript

import React, { useEffect } from "react";
import ExploreModelItem from "../ExploreModelItem";
import { getConfiguredModels } from "@/_hooks/useGetDownloadedModels";
import useGetConfiguredModels from "@/_hooks/useGetConfiguredModels";
import { Waveform } from "@uiball/loaders";
const ExploreModelList: React.FC = () => {
const { loading, models } = useGetConfiguredModels();
useEffect(() => {
getConfiguredModels();
}, []);
return (
<div className="flex flex-col flex-1 overflow-y-auto scroll">
{loading && (
<div className="mx-auto">
<Waveform size={24} color="#CBD5E0" />
</div>
)}
{models.map((item) => (
<ExploreModelItem key={item.id} model={item} />
))}
</div>
);
};
export default ExploreModelList;