#!/bin/bash

button() {
    local LANG=C

    # usage
    if [ "$1" = "help" ]; then
        echo "Usage: ${0##*/} [options]"
        echo '    buttonType="type"        variable: primary, secondary, success, danger, warning, info, light, dark, link'
        echo '    buttonText="text"        Button text'
        echo '    run="file.run"           File to be executed when clicking the button'
        echo ''
    fi

#It is only necessary to declare the variables that need changes in the content, the file that calls this script already creates the variable that will be used in the script

#iconSize
if [ -z "$buttonType" ];then
    buttonType=primary
fi

read -d $'' ShowText <<EOF
<div class="d-flex justify-content-center">
    <form class="form-check form-switch">
    <button onclick="_run('$run')" type="button" class="btn btn-$buttonType">$buttonText</button>
    </form>
</div>
EOF
echo "$ShowText"
}
