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

export const Submitted:ParseSchema = {
    title:"报送人",
    className:"Submitted",
    emptyImg:"/img/webhook-empty.png",
    include:["profile"],
    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:"profile",name:"姓名",type:"Pointer",targetClass:"Profile",isHeader:true,showName:"${name}"},
    ]
}