using Gtk 4.0;
using Adw 1;

template $SnapshotBox : Gtk.Box {
    orientation: vertical;
    spacing: 6;
    Box {
        margin-start: 12;
        margin-end:   12;
        margin-top:    6;
        spacing: 12;
        Box {
            orientation: vertical;
            Label title {
                label: _("No Name Set");
                wrap: true;
                wrap-mode: word_char;
                justify: left;
                halign: start;
                styles ["title-4"]
            }
            Label date {
                label: _("No date found");
                wrap: true;
                justify: left;
                halign: start;
            }
        }
        Label version {
            label: _("No version found");
            wrap: true;
            justify: right;
            hexpand: true;
            halign: end;
            natural-wrap-mode: none;
        }
    }
    Box {
        margin-start:  6;
        margin-end:    6;
        margin-bottom: 6;
        spacing: 3;
        homogeneous: true;
        Button apply_button {
            Adw.ButtonContent {
                label: _("Apply");
                icon-name: "check-plain-symbolic";
                can-shrink: true;
            }
            hexpand: true;
            styles ["flat"]
        }
        MenuButton rename_button {
            Adw.ButtonContent {
                label: _("Rename");
                icon-name: "edit-symbolic";
                can-shrink: true;
            }
            hexpand: true;
            styles ["flat"]
            popover: rename_menu;
        }
        Button trash_button {
            Adw.ButtonContent {
                label: _("Trash");
                icon-name: "user-trash-symbolic";
                can-shrink: true;
            }
            hexpand: true;
            styles ["flat"]
        }
    }
}

Popover rename_menu {
    Box {
        orientation: vertical;
        spacing: 11;
        margin-start:  12;
        margin-end:    12;
        margin-top: 5;
        margin-bottom: 12;
        Label {
            label: _("Rename Snapshot?");
            styles ["title-2"]
        }
        Box {
            spacing: 6;
            Entry rename_entry {
                text: bind title.label;
            }
            Button apply_rename {
                icon-name: "check-plain-symbolic";
                tooltip-text: _("Confirm Rename");
                styles ["circular", "suggested-action"]
            }
        }
    }
}
