UNPKG

create-automaticgpt-template

Version:

AutomaticGPT - A production-ready Expo template with AI chat, authentication, conversation management, analytics, and sharing features

25 lines (19 loc) 406 B
import { useState, useCallback } from 'react'; export function useSidebar() { const [isOpen, setIsOpen] = useState(false); const open = useCallback(() => { setIsOpen(true); }, []); const close = useCallback(() => { setIsOpen(false); }, []); const toggle = useCallback(() => { setIsOpen((prev) => !prev); }, []); return { isOpen, open, close, toggle, }; }