<Overlay
    @onLoad={{this.setOverlayContext}}
    @position="right"
    @noBackdrop={{true}}
    @fullHeight={{true}}
    @isResizable={{or this.isResizable @isResizable}}
    @width={{or this.width @width "600px"}}
>
    <Overlay::Header @hideLeftSection={{true}} @actionsWrapperClass="flex-1 flex-col py-3" class="h-auto-i min-h-[127px]">
        <div class="flex flex-row items-center justify-between w-full mb-4">
            <div class="flex flex-1 space-x-2">
                <Button @type="default" @icon="pen" @helpText="Edit product" @onClick={{this.onEdit}} />
            </div>
            <div class="flex flex-1 justify-end">
                <Button @type="default" @icon="times" @helpText={{if this.product.id "Cancel edit product" "Cancel new product"}} @onClick={{this.onPressCancel}} />
            </div>
        </div>
        <div class="flex flex-row justify-between w-full">
            <div class="flex flex-col flex-1 w-3/4">
                <div class="flex flex-row">
                    <div class="flex flex-col">
                        <h1 class="text-gray-900 dark:text-white text-2xl">{{this.product.name}}</h1>
                    </div>
                </div>
            </div>
        </div>
    </Overlay::Header>
    <Overlay::Body class="no-padding" @increaseInnerBodyHeightBy={{1000}}>
        <div class="section-header-actions w-full overflow-x-scroll lg:overflow-x-auto">
            <div class="ui-tabs mt-4">
                <nav>
                    {{#each this.tabs as |tab|}}
                        <a href="javascript:;" class="ui-tab {{if (eq this.tab.slug tab.slug) 'active'}}" {{on "click" (fn this.onTabChanged tab.slug)}}>
                            <FaIcon @icon={{tab.icon}} class="mr-1" />
                            <span>{{tab.title}}</span>
                        </a>
                    {{/each}}
                </nav>
            </div>
        </div>
        <div class="tab-content tab-{{this.tab.slug}}">
            {{component this.tab.component product=this.product tabOptions=this.tab options=this.tab.componentParams}}
        </div>
    </Overlay::Body>
</Overlay>