some final fixes before the demo

This commit is contained in:
sara-pervana
2023-12-12 14:02:43 +01:00
parent 85d62aac89
commit 7a7724f977
22 changed files with 577 additions and 589 deletions

View File

@@ -0,0 +1,19 @@
import { useContext } from "react";
import { AppContext } from "./useAppContext";
const useGetEntityByName = (nameOrDid: string) => {
const { data } = useContext(AppContext);
const allEntities = data.allEntities;
if (!allEntities) {
return { entity: undefined, isLoading: true };
}
const entity = allEntities.find(
(entity) => entity.name === nameOrDid || entity.did === nameOrDid
);
return { entity, isLoading: false };
};
export default useGetEntityByName;