/*
 * Copyright (C) 2025  Tim Zimmermann <tim@aglais.org>
 *
 * This program is free software: you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU Affero General Public License for more details.
 *
 * You should have received a copy of the GNU Affero General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */

package org.aglais.zms.ui.component;

import javax.swing.*;
import java.awt.*;

/**
 * A specialized JButton that represents a danger-styled button, typically used
 * to indicate a warning, critical action, or important emphasis. The appearance
 * of this button includes a red background and white text for high visibility.
 */
public class DangerButton extends JButton {

    /**
     * Creates a danger-styled button with the specified text.
     * This button is styled with a red background to signify caution or emphasis
     * and white text for contrast against the background.
     *
     * @param text The text to display on the button. If null, no text will be displayed.
     */
    public DangerButton(String text) {
        super(text);

        setBackground(new Color(220, 53, 69));
        setForeground(Color.WHITE);
    }

    /**
     * Creates a danger-styled button with no text.
     * This button is styled with a red background to signify caution or emphasis
     * and white text for contrast against the background.
     */
    public DangerButton() {
        this(null);
    }

}
