import { useState, useCallback } from 'react';

export default function useGlobalModel() {
  const [controlCenter, setControlCenter] = useState(false);

  const toggleControlCenter = useCallback(() => {
    setControlCenter(!controlCenter);
  }, [controlCenter]);

  const closeControlCenter = useCallback(() => {
    setControlCenter(false);
  }, []);

  return {
    controlCenter,
    toggleControlCenter,
    closeControlCenter,
  };
}
