Skip to content

Commit

Permalink
Merge pull request #16 from dcSpark/nico/add_deployed_badge_and_loading
Browse files Browse the repository at this point in the history
feat: adds deployed badge and loading
  • Loading branch information
nicarq authored Dec 22, 2024
2 parents d7483d4 + 5a76555 commit ecbb382
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Shinkai Tools 🛠️

[![Deployed Site](https://img.shields.io/badge/Deployed-Site-brightgreen)](https://packages.shinkai.com)

A collection of official tools for Shinkai, providing various functionalities from basic examples to advanced search capabilities.

## Overview
Expand Down
13 changes: 11 additions & 2 deletions registry/src/components/PackageList.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,21 @@ import {

function PackageList({ searchQuery }) {
const [packageData, setPackageData] = useState([]);
const [loading, setLoading] = useState(true);
const [dialogOpen, setDialogOpen] = useState(false);
const [snackbarOpen, setSnackbarOpen] = useState(false);

useEffect(() => {
fetch('https://packages.shinkai.com/tools/directory.json')
.then(response => response.json())
.then(data => setPackageData(data))
.then(data => {
setPackageData(data);
setLoading(false);
})
.catch(error => {
console.error('Error fetching package data:', error);
setPackageData([]);
setLoading(false);
});
}, []);

Expand Down Expand Up @@ -88,7 +93,11 @@ function PackageList({ searchQuery }) {
<>
<Container maxWidth="lg">
<Stack spacing={3}>
{filteredPackages.length === 0 ? (
{loading ? (
<Typography variant="h6" color="text.secondary">
Loading packages...
</Typography>
) : filteredPackages.length === 0 ? (
<Alert
severity="info"
sx={{
Expand Down

0 comments on commit ecbb382

Please sign in to comment.