<template>
	<div class="form-group" :class="{'has-error': form.errors.has(input_name)}">
        <div>
            <label v-if="label" for="name">{{ label }}</label>
        </div>
        <v-radio-group v-model="form[input_name]" :mandatory="false">
            <v-radio
                v-if="list" v-for="(item, $index) in list" :key="$index"
                color="primary"
                :label="item.name" 
                :value="item.id"
             ></v-radio>
        </v-radio-group>
        <div class="text-danger text-left" v-if="form.errors.has(input_name)" v-text="form.errors.get(input_name)"></div>
    </div>
</template>

<script type="text/javascript">
	export default {
        props: {
            input_name: String,
            form: Object,
            list: Array,
            label: String,
        }
	}
</script>