import { X } from "lucide-react"; import { memo, type ReactNode } from "react"; import type { SidePanelTab } from "../hooks/useSidePanelState"; export type SidePanelTabConfig = { key: SidePanelTab; label: string; count: number; content: ReactNode; }; interface SidePanelProps { open: boolean; mounted: boolean; tab: SidePanelTab; tabs: SidePanelTabConfig[]; onTabChange: (tab: SidePanelTab) => void; onClose: () => void; } // 右侧(竖屏为底部抽屉)的侧栏外壳:评论 / TA的作品 / 搜索结果(或 hashtag)几个标签页 export const SidePanel = memo(function SidePanel({ open, mounted, tab, tabs, onTabChange, onClose, }: SidePanelProps) { const visibility = open ? "translate-y-0 pointer-events-auto landscape:w-[min(420px,36vw)] landscape:border-l landscape:border-white/10" : "translate-y-full pointer-events-none landscape:w-0 landscape:border-l-0"; // 竖屏时作品网格不需要那么高,给视频多留点位置 const portraitHeight = tab === "comments" ? "h-[min(80vh,88dvh)]" : "h-[min(62vh,64dvh)]"; return ( ); });