import './card-proj-edit.css';
import {EditStepEnum, IProjEdit} from "../../interfaces/card/ICardProj.ts";

export default function CardProjEdit(props: IProjEdit) {

    const renderBtn = () => {
        if (props.canBtnClick == false) {
            return <a href="/#" className="edit" style={{color: 'var(--color-border)'}} onClick={(e) => {
                e.preventDefault();
            }}>{props.btnName ? props.btnName : '编辑'}</a>
        } else {
            return <a href="/#" className="edit" onClick={(e) => {
                e.preventDefault();
                props.handleEdit();
            }}>{props.btnName ? props.btnName : '编辑'}</a>
        }
    }

    return (
        <div className="card-proj-edit">
            <div className="title">{props.title}</div>
            <div className="desc">{props.desc}</div>
            <div className="option">
                {renderBtn()}
                {props.status == EditStepEnum.EDITED ? <span className="status"></span> : <></>}
            </div>
        </div>
    )
}