Loading...
;
- }
+ const { data: groups, isLoading } = useGroupsQuery(
+ { type: selected?.value ? Number(selected?.value) : undefined },
+ {
+ order: { column: 'updated_at', options: { ascending: false } },
+ },
+ );
- const handleChangeFilter = (selected: Option[]) => {
+ const handleChangeFilter = (selected: Option) => {
setSelected(selected);
};
return (
- {groups && (
-
- {groups.map((group) => (
-
- ))}
-
+ {isLoading ? (
+
Loading...
+ ) : (
+ groups && (
+
+ {groups.map((group) => (
+
+ ))}
+
+ )
)}
);
diff --git a/src/types/supabase.ts b/src/types/supabase.ts
index d71f081..2e0f595 100644
--- a/src/types/supabase.ts
+++ b/src/types/supabase.ts
@@ -16,7 +16,7 @@ export type Json =
export type Table