Skip to content

The open-source AI receptionist for businesses. Answers every call, books the appointment and hands over to a person when needed. You own the code and the data.

993 B
Raw Blame
// The title bar of a page without a header of its own: the menu, then the page's title. A page inside another one says
// where it sits as a breadcrumb, "Settings › Assistant" or "Integrations › Zapier": the first part links back up (its
// tooltip names the way back), the last is the page itself. Styles: `.pagebar` in styles.css.
import type { ReactNode } from 'react'
import { Icon } from '../ui/kit.tsx'

type Up = {
  href: string
  label: string
  /** The tooltip: where the link goes and its key ("All settings (G S)", "Back to all integrations (Esc)"). */
  title: string
}

export function PageBar({ menu, up, title }: { menu: ReactNode; up?: Up; title: string }) {
  return (
    <div className="pagebar">
      {menu}
      {up && (
        <>
          <a className="pagebar-up" href={up.href} title={up.title}>
            {up.label}
          </a>
          <Icon name="right" size={13} className="pagebar-sep" />
        </>
      )}
      <b>{title}</b>
    </div>
  )
}