import { useState } from "react";
//#region src/plus/saasDevice/devicePlanning/hooks/useDevicePlanningDialogs.ts
const useDevicePlanningDialogs = () => {
	const [addDeviceOpen, setAddDeviceOpen] = useState(false);
	const [detailOpen, setDetailOpen] = useState(false);
	const [selectedDevice, setSelectedDevice] = useState();
	const [detailInitialTab, setDetailInitialTab] = useState("info");
	const [editDeviceOpen, setEditDeviceOpen] = useState(false);
	const [deleteDeviceOpen, setDeleteDeviceOpen] = useState(false);
	const [workAreaModalOpen, setWorkAreaModalOpen] = useState(false);
	const [workAreaModalMode, setWorkAreaModalMode] = useState("create");
	const [editingWorkArea, setEditingWorkArea] = useState();
	const openCreateWorkArea = () => {
		setWorkAreaModalMode("create");
		setEditingWorkArea(void 0);
		setWorkAreaModalOpen(true);
	};
	const openEditWorkArea = (record) => {
		setWorkAreaModalMode("edit");
		setEditingWorkArea(record);
		setWorkAreaModalOpen(true);
	};
	const closeWorkAreaModal = () => {
		setWorkAreaModalOpen(false);
		setEditingWorkArea(void 0);
	};
	const openDeviceDetail = (record, initialTab) => {
		setSelectedDevice(record);
		setDetailInitialTab(initialTab);
		setDetailOpen(true);
	};
	const closeDeviceDetail = () => {
		setDetailOpen(false);
		setSelectedDevice(void 0);
	};
	const clearSelectedDevice = () => {
		setSelectedDevice(void 0);
	};
	return {
		addDeviceOpen,
		detailOpen,
		selectedDevice,
		detailInitialTab,
		editDeviceOpen,
		deleteDeviceOpen,
		workAreaModalOpen,
		workAreaModalMode,
		editingWorkArea,
		setAddDeviceOpen,
		setDetailOpen,
		setSelectedDevice,
		setDetailInitialTab,
		setEditDeviceOpen,
		setDeleteDeviceOpen,
		setWorkAreaModalOpen,
		openCreateWorkArea,
		openEditWorkArea,
		closeWorkAreaModal,
		openDeviceDetail,
		closeDeviceDetail,
		clearSelectedDevice
	};
};
//#endregion
export { useDevicePlanningDialogs };
