import { ChevronRight } from "lucide-react";
import Link from "next/link";
import { memo } from "react";
import type { PlaylistState } from "../hooks/usePlaylist";
import type { User } from "../types.ts";
import { WorksGrid } from "./WorksGrid";
interface AuthorWorksTabProps {
/** 侧栏打开且停在「TA的作品」标签页 */
active: boolean;
author: User;
works: PlaylistState;
currentId: string;
/** 跳转时原样带上的播放上下文查询串 */
contextQuery: string;
onSelect: () => void;
}
// 侧栏「TA的作品」:作者在库里的全部作品。点作品就地切换;点作者名字才去独立的作者页。
export const AuthorWorksTab = memo(function AuthorWorksTab({
active,
author,
works,
currentId,
contextQuery,
onSelect,
}: AuthorWorksTabProps) {
const header = author.sec_uid ? (
{/* biome-ignore lint/performance/noImgElement: 头像来自对象存储,不走 next/image */}
@{author.nickname}
作者主页
) : (
@{author.nickname}
);
return (
);
});