// ConfirmDialog.qml
import QtQuick
import QtQuick.Controls
import QtQuick.Layouts
import QtQuick.Controls.Material

Dialog {
    id: dialog
    title: "确认操作"
    modal: true
    standardButtons: Dialog.Yes | Dialog.No
    Material.theme: Material.Light
    Material.accent: Material.primary

    x: (parent.width - width) / 2
    y: (parent.height - height) / 2

    property string studentId

    signal confirmed(string studentId)

    onAccepted: confirmed(studentId)

    ColumnLayout {
        anchors.fill: parent
        spacing: 15

        Label {
            text: `确定要删除学号为 <b>${studentId}</b> 的学生吗?`
            wrapMode: Text.Wrap
            Layout.fillWidth: true
        }

        Label {
            text: "此操作不可撤销!"
            color: "#e53935"
            font.bold: true
        }

        // 警告图标
        Label {
                    Layout.alignment: Qt.AlignHCenter
                    text: "⚠️" // 使用警告符号
                    font.pixelSize: 48
                }
    }
}