<template>
    <FileUploader
        :url="`/api/images/upload?sizes=${sizes}`"
        :multiple="multiple"
        mime="image/*"
        :name="name"
        :form="form"
        @uploaded="uploaded"
    >
        <Icon v="upload" />
        <T>images.upload.instruction{{ small ? 'Short' : '' }}</T>
    </FileUploader>
</template>

<script>
export default {
    props: {
        multiple: { type: Boolean },
        name: { default: 'images' },
        form: { type: Boolean },
        small: { type: Boolean },
        sizes: { default: 'all' },
    },
    emits: ['uploaded'],
    methods: {
        uploaded(ids) {
            this.$emit('uploaded', ids);
        },
    },
};
</script>
