pragma ComponentBehavior: Bound

import QtQuick
import QtQuick.Layouts
import qs.Components
import ZShell.Config
import qs.Services

ConnectedRect {
	id: root

	property alias icon: icon.text
	property alias status: status.text
	property alias text: label.text

	signal clicked

	Layout.fillWidth: true
	implicitHeight: navLayout.implicitHeight + navLayout.anchors.margins * 2

	StateLayer {
		onClicked: root.clicked()
	}

	RowLayout {
		id: navLayout

		anchors.fill: parent
		anchors.leftMargin: Tokens.padding.largeIncreased
		anchors.margins: Tokens.padding.small
		anchors.rightMargin: Tokens.padding.largeIncreased
		spacing: Tokens.spacing.medium

		MaterialIcon {
			id: icon

			color: Colors.palette.m3onSurfaceVariant
			font.pointSize: Tokens.font.size.large
		}

		ColumnLayout {
			Layout.fillWidth: true
			spacing: 0

			CustomText {
				id: label

				Layout.fillWidth: true
				elide: Text.ElideRight
				font.pointSize: Tokens.font.size.small
			}

			CustomText {
				id: status

				Layout.fillWidth: true
				animate: true
				color: Colors.palette.m3outline
				elide: Text.ElideRight
				font.pointSize: Tokens.font.size.small
				visible: text
			}
		}

		MaterialIcon {
			color: Colors.palette.m3onSurfaceVariant
			font.pointSize: Tokens.font.size.normal
			text: "chevron_right"
		}
	}
}
