import { MatDialog } from "@angular/material/dialog";
import { Router } from "@angular/router";
import Parse from "parse";
import { ParseSchema } from "./func-parse";

export const Profile:ParseSchema = {
    title:"报送人",
    className:"Profile",
    emptyImg:"/img/webhook-empty.png",
    include:["user"],
    buttons:[
        {
            name:"编辑",
            place:"item",
            show:(options:{object:Parse.Object})=>{
                if(location?.pathname=='/nav-author/manage/space'){
                    return true
                }
                return false
            },
            handle:(options:{dialog:MatDialog,object:Parse.Object,router?:Router})=>{
                options.router?.navigate(['/nav-author/manage/apply',{id:options.object.id}])
            }
        }
    ],
    fieldsArray:[
        {key:"user",name:"姓名",type:"Pointer",targetClass:"_User",isHeader:true,showName:"${name}"},
        {key:"user",name:"手机号",type:"Pointer",targetClass:"_User",isHeader:true,showName:"${phone}"},
        {key:"user",name:"邮箱",type:"Pointer",targetClass:"_User",isHeader:true,showName:"${email}"},
    ]
}