import QtQuick
import QtQuick.Layouts
import QtQuick.Controls
import Qt.labs.qmlmodels

ColumnLayout {
    function viewOffers(criterion) {
    //offer_model.viewCriterion(criterion)
    }

    anchors.fill: parent
    spacing: Dimensions.l

    RowLayout {
        Layout.fillWidth: true
        spacing: Dimensions.l

        SearchBar {
            id: searchBar

        }
        QuickFilter {
            model: ListModel {
                ListElement {
                    name: "Alle"
                    selected: true
                    text: qsTr("Alle")
                }
                ListElement {
                    name: "Offen"
                    selected: false
                    text: qsTr("Offen")
                }
                ListElement {
                    name: "Abgeschlossen"
                    selected: false
                    text: qsTr("Abgeschlossen")
                }
                ListElement {
                    name: "Erledigt"
                    selected: false
                    text: qsTr("Erledigt")
                }
            }

            onSelectedChanged: name => {
                business_model.viewCriterion(name);
            }
        }
        Button {
            id: addOfferBtn

            Layout.alignment: Qt.AlignRight
            flat: true
            icon.source: "qrc:/images/PlusCircle.svg"
            text: qsTr("Angebote Hinzufügen")

            onClicked: contentStack.push("AddOffer.qml")
        }
    }
    Item {
        id: spacer

        Layout.fillHeight: true
    }
}
