import React, { useEffect } from 'react';
import GroupFrom from './GroupForm'
import axios from 'axios';

function GropNew(props){
  const OIdentifier = props.match.params.OIdentifier;
  // 更改网页标签
  useEffect(()=>{
    OIdentifier && axios.get(`/organizations/${OIdentifier}.json`).then(result=>{
      if(result && result.data){
        const {nickname} = result.data;
        document.title = `新建团队-${nickname}`
      }
    }).catch(error=>{})
  },[OIdentifier])

  return(
    <div className="teamDetail">
      <GroupFrom {...props}></GroupFrom>
    </div>
  )
}
export default GropNew;