The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import { useState } from "react"; |
| 2 | |
| 3 | export function useComposerMenuState(hidden = false) { |
| 4 | const [open, setOpen] = useState(false); |
| 5 | // Closing via the open prop does not notify Base UI listeners; reset stored state too. |
| 6 | if (hidden && open) { |
| 7 | setOpen(false); |
| 8 | } |
| 9 | return [open && !hidden, setOpen] as const; |
| 10 | } |