feat: org selector

This commit is contained in:
Nevo David 2024-03-09 23:27:26 +07:00
parent 3d27d68cc8
commit 9499bde725
1 changed files with 5 additions and 1 deletions

View File

@ -13,7 +13,7 @@ export const OrganizationSelector = () => {
return await (await fetch('/user/organizations')).json();
}, []);
const { data } = useSWR('organizations', load, {
const { isLoading, data } = useSWR('organizations', load, {
revalidateIfStale: false,
revalidateOnFocus: false,
refreshWhenOffline: false,
@ -41,6 +41,10 @@ export const OrganizationSelector = () => {
[]
);
if (isLoading || !isLoading && data?.length === 0) {
return null;
}
return (
<div className="bg-third h-[48px] flex items-center min-w-[172px] select-none relative group">
<div className="border-tableBorder py-[8px] px-[12px] border w-full h-full flex items-center">