File size: 817 Bytes
103a492
 
 
 
 
 
3fac176
103a492
 
 
3fac176
 
 
 
 
 
 
 
 
 
 
 
103a492
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import type { ReactNode } from "react";
import "../styles/sdlc76/app-frame.css";

interface AppFrameProps {
  appName: string;
  actions?: ReactNode;
  rail?: ReactNode;
  children?: ReactNode;
}

export function AppFrame({ appName, actions, rail, children }: AppFrameProps) {
  const header = <header className="cg-map-bar cg-app-frame-header">
    {rail ? null : <a className="cg-app-frame-back" href="#/app">Back to Apps</a>}
    <span className="cg-app-map-name cg-app-frame-name" title={appName} aria-label="App name">
      <strong>{appName}</strong>
    </span>
    {actions}
  </header>;
  // With a rail, the header and body share one column beside it, and the rail carries the Back.
  return rail
    ? <>{rail}<div className="cg-app-frame-main">{header}{children}</div></>
    : <>{header}{children}</>;
}