20 lines
431 B
TypeScript
20 lines
431 B
TypeScript
|
|
import { Sidebar } from './Sidebar';
|
||
|
|
import type { ViewKey } from '../types';
|
||
|
|
|
||
|
|
interface Props {
|
||
|
|
current: ViewKey;
|
||
|
|
onNavigate: (v: ViewKey) => void;
|
||
|
|
children: React.ReactNode;
|
||
|
|
}
|
||
|
|
|
||
|
|
export function AppLayout({ current, onNavigate, children }: Props) {
|
||
|
|
return (
|
||
|
|
<div className="app">
|
||
|
|
<Sidebar current={current} onChange={onNavigate} />
|
||
|
|
<main className="main">
|
||
|
|
{children}
|
||
|
|
</main>
|
||
|
|
</div>
|
||
|
|
);
|
||
|
|
}
|