diff --git a/frontend/src/components/GroupSwitcher.tsx b/frontend/src/components/GroupSwitcher.tsx index eaa5df8..6d12d1f 100644 --- a/frontend/src/components/GroupSwitcher.tsx +++ b/frontend/src/components/GroupSwitcher.tsx @@ -1,8 +1,12 @@ +import { useState } from "react"; + import { useMe, useSetActiveGroup } from "../hooks/auth"; +import { CreateGroupForm } from "./CreateGroupForm"; export function GroupSwitcher() { const { data: me } = useMe(); const setActive = useSetActiveGroup(); + const [creating, setCreating] = useState(false); if (!me || me.groups.length === 0) return null; return ( @@ -21,7 +25,21 @@ export function GroupSwitcher() { ); })} + {/* Плашка создания новой группы — в одном ряду логики с выбором группы. */} + + + {creating && ( +
+ setCreating(false)} /> +
+ )} ); }