@namespace Connected.Components
@inherits UIComponent

@Css
<div @attributes="CustomAttributes" class="@SnackbarClass" style="@AnimationStyle" @onclick="@SnackbarClicked">
    @if (!HideIcon)
    {
        <div class="snackbar-icon">
            <Icon Icon="@Icon" Color="@IconColor" Size="@IconSize" />
        </div>
    }

    <div class="snackbar-content-message">
        @if (Message?.ComponentType != null)
        {
            <DynamicComponent Type="Message.ComponentType" Parameters="Message.ComponentParameters" />
        }
    </div>

    @if (ShowCloseIcon || ShowActionButton)
    {
        <div class="snackbar-content-action">

            @if (ShowActionButton)
            {
                <Button Variant="@ActionVariant" Color="@ActionColor" OnClick="ActionClicked" DisableElevation>@Action</Button>
            }

            @if (ShowCloseIcon)
            {
                <IconButton Icon="@CloseIcon" Size="Size.Small" Class="ms-2" OnClick="CloseIconClicked" />
            }
        </div>
    }
</div>
