import React, { useState, useCallback } from 'react';

export default function () {
  const [searchBuildId, setSearchBuildId] = useState<string>(); //搜索的建筑id
  const [searchFloorId, setSearchFloorId] = useState<string>(); //搜索的楼层id
  const [searchText, setSearchText] = useState<any>({}); //搜索的空间名字
  const [searchSpace, setSearchSpace] = useState<any>({}); //搜索的空间信息
  const changeSearchBuildId = useCallback((value: string) => {
    setSearchBuildId(value);
  }, []);
  const changeSearchFloorId = useCallback((value: string) => {
    setSearchFloorId(value);
  }, []);
  const changeSearchText = useCallback((value: any) => {
    setSearchText(value);
  }, []);
  const changeSearchSpace = useCallback((value: any) => {
    setSearchSpace(value);
  }, []);
  return {
    searchBuildId,
    searchFloorId,
    searchText,
    searchSpace,
    changeSearchBuildId,
    changeSearchFloorId,
    changeSearchText,
    changeSearchSpace,
  };
}
