<template>
    <v-sheet class="transparent text-caption text-center" width="100%">

        <v-chip :color="status == 'public' ? 'green' : 'red'" outlined small @click="OnClick">
            <v-icon small>
                mdi-{{status == 'public' ? 'check' : 'lock'}}
            </v-icon>
        </v-chip>

    </v-sheet>
</template>

<script>
    export default {
        props: {
            app: {required: true},
            column: {required: true},

            createdby: {default: null},
            customer: {default: null},
            created_at: {default: null},

            allow_upload_row_files: {default: true},
            
            fakeData: {default: false},
        },

        computed: {
            controller() {
                return this.app.classes.Customerregistru;
            },

            status() {
                return this.column.text;
            }
        },

        methods: {
            OnClick(e) {
                if( ! this.fakeData )
                {
                    this.controller.changerowstatus.visible = false;

                    this.$nextTick( () => {

                        this.controller.changerowstatus.visible = true;
                        this.controller.changerowstatus.x = e.clientX;
                        this.controller.changerowstatus.y = e.clientY;
                        this.controller.changerowstatus.row_id = this.column.row_id;
                        this.controller.changerowstatus.status = this.column.text;

                    });
                }
            }
        },

        name: 'RegistruTableBodyColumnStatus'
    }
</script>