<div class="drawer-contents">
  <div
    class:no-sidebar={!$$slots.sidebar}
    class="container"
    data-cy="binding-dropdown-modal"
  >
    {#if $$slots.sidebar}
      <div class="sidebar">
        <slot name="sidebar" />
      </div>
    {/if}
    <div class="main">
      <slot name="main" />
    </div>
  </div>
</div>

<style>
  .drawer-contents {
    height: 40vh;
    overflow-y: auto;
  }
  .container {
    height: 100%;
    display: grid;
    grid-template-columns: 290px 1fr;
  }
  .no-sidebar {
    grid-template-columns: 1fr;
  }
  .sidebar {
    border-right: var(--border-light);
    overflow: auto;
  }

  .sidebar::-webkit-scrollbar {
    display: none;
  }

  .main {
    font-family: var(--font-sans);
  }
  .main :global(textarea) {
    min-height: 200px;
  }
  .main :global(p) {
    margin: 0;
  }
</style>
