import { ChangeDetectionStrategy, Component } from '@angular/core';
import { RouterOutlet } from '@angular/router';
import { HlmSidebarImports } from '@spartan-ng/helm/sidebar';
import { HlmToasterImports } from '@spartan-ng/helm/sonner';

import { AppSidebar } from './sidebar/app-sidebar';
import { SiteHeader } from './site-header';

@Component({
  selector: 'admin-layout',
  imports: [RouterOutlet, HlmSidebarImports, HlmToasterImports, AppSidebar, SiteHeader],
  changeDetection: ChangeDetectionStrategy.OnPush,
  template: `
    <app-sidebar>
      <main
        class="min-w-0 overflow-x-hidden"
        hlmSidebarInset
      >
        <app-site-header />
        <div class="flex flex-1 flex-col px-4 pb-4">
          <router-outlet />
        </div>
      </main>
    </app-sidebar>
    <hlm-toaster />
  `,
})
export default class AdminLayout {}
