import { Nine, Label } from "base.slint";
import { Pieces } from "pieces.slint";
import { Icons } from "icons.slint";
export component ErrorBanner {
    in property <bool> negative: true;
    in property <string> text;
    in property <bool> wrap-text;
    preferred-height: 60px;
    Nine { x: -4px; y: -4px; width: root.width + 8px; height: root.height + 8px; source: root.negative ? Pieces.negative-message-frame-default-shadow : Pieces.subheader-frame-default-shadow; }
    Nine { width: root.width; height: root.height; source: root.negative ? Pieces.negative-message-frame-default-base : Pieces.subheader-frame-default-base; }
    if root.negative: Image { x: label.x - 20px; y: (root.height - 16px)/2 - 2px; width: 16px; height: 16px; source: Icons.warning; image-rendering: pixelated; }
    label := Label { x: root.wrap-text ? 32px : (root.width - self.preferred-width + 20px)/2; y: -2px; width: root.wrap-text ? root.width - 48px : self.preferred-width; height: root.height; text: root.text; wrap: root.wrap-text ? word-wrap : no-wrap; font-weight: 600; vertical-alignment: center; }
}
