Files
Mujoco_WASM/web_platform/src/app/components/SidebarPanel.tsx
T
chenlin cb3fb47561
web-platform-ci / TypeScript, lint, unit, build (push) Has been cancelled
web-platform-ci / Playwright E2E (push) Has been cancelled
web-platform-ci / TypeScript, lint, unit, build (pull_request) Has been cancelled
web-platform-ci / Playwright E2E (pull_request) Has been cancelled
feat(web-platform): release V0.9.4 前端设计优化
2026-09-09 13:15:46 +08:00

34 lines
1016 B
TypeScript

import type { ReactNode } from 'react';
import { Settings2 } from 'lucide-react';
import { ResizablePanel } from '../../components/ui';
export function SidebarPanel({
title,
side,
children,
visible = true,
icon,
}: {
title: string;
side: 'left' | 'right';
children: ReactNode;
visible?: boolean;
icon?: ReactNode;
}) {
return (
<ResizablePanel side={side} storageKey={`mujoco-${side}-sidebar-width`} visible={visible}>
<aside
className={`cyber-sidebar flex h-full w-full min-w-0 flex-col overflow-hidden ${side === 'left' ? 'border-r' : 'border-l'} border-border-subtle `}
>
<h2 className="flex h-9 shrink-0 items-center gap-2 border-b border-border-subtle px-3 text-xs font-semibold text-text-primary">
<span className="text-accent [&>svg]:h-4 [&>svg]:w-4">
{icon ?? <Settings2 aria-hidden="true" className="h-3.5 w-3.5" />}
</span>
{title}
</h2>
{children}
</aside>
</ResizablePanel>
);
}