import QtQuick
import Quickshell
import Quickshell.Hyprland
import "../../../colors"

Rectangle {  //workspace
    width: timeDisplay.width + 16
    height: timeDisplay.height + 16
    radius: 4
    color: Colors.primaryContainer
    border.color: Colors.primaryContainer_fg
    border.width: 2

    Text {
        id: timeDisplay

        property string currentTime: ""

        text: currentTime
        color: Colors.primary
        font.pixelSize: 18
        font.family: "Inter, sans-serif"

        anchors.centerIn: parent

        //Update time every second
        Timer {
            interval: 1000
            running: true
            repeat: true
            onTriggered: {
                var now = new Date()
                timeDisplay.currentTime = Qt.formatTime(now, "hh:mm:ss")
            }
        }
    }
}