import QtQuick 2.12
import QtQuick.Controls 2.12

Item {
    id: control

    property var images: []

    SwipeView {
        id: view

        clip: true

        anchors.fill: parent
        anchors.margins: 1
        anchors.bottomMargin: indicator.height
        spacing: width * 0.2

        Repeater {
            model: control.images.length
            delegate: Image {
                source: control.images[index]
                    fillMode: Image.PreserveAspectFit
            }
        }
    }

    PageIndicator {
        id: indicator

        anchors.bottom: control.bottom
        anchors.horizontalCenter: parent.horizontalCenter

        count: view.count
        currentIndex: view.currentIndex
    }
}
