import { useState } from 'react';
import { UseDrawerReturn } from '../types.js';

export const useDrawer = (): UseDrawerReturn => {
  const [isOpen, setIsOpen] = useState(false);

  return {
    isOpen,
    open: () => setIsOpen(true),
    close: () => setIsOpen(false),
    toggle: () => setIsOpen(prev => !prev),
  };
};
