feat: org selector
This commit is contained in:
parent
3d27d68cc8
commit
9499bde725
|
|
@ -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">
|
||||
|
|
|
|||
Loading…
Reference in New Issue