// @ts-nocheck
import React from 'react';
import BaseClone from './base-clone';

import { Link } from 'react-router-dom';

import { Tag } from 'antd';


class DetailLoader extends BaseClone {
    name;

    endpoint;

    fields;

    constructor(model = {}) {
        super();

        this.id = model.id;

        this.name = model.name;

        this.endpoint = model.name;

        this.fields = [
            {
                field: 'name',
                caption: 'Name',
            },
            {
                field: 'amount',
                caption: 'Amount',
            },
        ];
    }

    // get filterDate() {
    //     return true;
    // }

    // get getEndpoint() {
    //     return this.name;
    // }

    get path() {
        return this.name;
        // return `collections`;
    }

    get getName() {
        return this.name;
    }

    get modelName() {
        return this.name;
    }

    /**
     * Link for redirection
     */
    get link() {
        return this.name.toLowerCase();
    }

    get columns() {
        return [
            {
                caption: 'Name',
                field: 'name',
                key: 'name',
            },
            {
                caption: 'Weight',
                field: 'weight',
                key: 'weight',
            },
            {
                caption: 'Date',
                field: 'created_at',
                key: 'created_at',
            },
        ];
    }

}

export default DetailLoader;
