useState(false) gives you setValue, so every call site ends up
spelling out setValue(true), setValue(false), setValue(v => !v).
Wrap it once instead, and the intent - on, off, toggle - moves
to the call site. The setters and the object holding them stay stable
across renders, so they pass cleanly as props or effect deps.
@itsnas panel.tsx
codepanel.tsx
main
Nas (@itsnas)
main
Nas (@itsnas)