<Overlay
    @onLoad={{this.setOverlayContext}}
    @position="right"
    @noBackdrop={{true}}
    @fullHeight={{true}}
    @isResizable={{or this.isResizable @isResizable}}
    @width={{or this.width @width "570px"}}
>
    <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 justify-end">
                <Button
                    @type="default"
                    @icon="times"
                    @helpText={{if this.customer.id (t "storefront.customers.customer-panel.cancel-edit-button") (t "fleet-ops.component.customer-panel.cancel-new-button")}}
                    @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="w-14 flex items-center justify-start">
                        <Image
                            src={{this.customer.photo_url}}
                            @fallbackSrc={{config "defaultValues.customerImage"}}
                            alt={{this.customer.name}}
                            height="48"
                            width="48"
                            class="h-12 w-12 rounded-lg shadow-sm"
                        />
                        <Attach::Tooltip @class="clean" @animation="scale" @placement="top">
                            <InputInfo @text={{this.customer.public_id}} />
                        </Attach::Tooltip>
                    </div>
                    <div class="flex flex-col">
                        <h1 class="text-gray-900 dark:text-white text-2xl">{{this.customer.name}}</h1>
                        <div class="-mt-1">
                            <div class="flex flex-row items-center">
                                <span class="text-sm dark:text-blue-400 text-blue-600">{{smart-humanize this.customer.type}}</span>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
            <div class="flex justify-end w-1/4">
                <Badge @status={{this.customer.public_id}} @type="info" @hideStatusDot={{true}} />
            </div>

        </div>
    </Overlay::Header>
    <Overlay::Body class="no-padding">
        <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 customer=this.customer tabOptions=this.tab options=this.tab.componentParams}}
        </div>
    </Overlay::Body>
</Overlay>