Files
Genarrative/src/components/PixelCloseButton.tsx
T
kdletters 94122583ac 收口前端平台组件能力
新增 PlatformAsyncStatePanel 统一 profile 异步状态骨架
扩展 PlatformSegmentedTabs 支持滚动 tab 并接入创作入口与发现页
统一 PixelCloseButton 复用 PlatformModalCloseButton 像素关闭能力
抽取平台入口泥点前置提示弹层并收紧阻断语义
补充组件收口文档与共享决策记录
2026-06-11 01:06:31 +08:00

35 lines
927 B
TypeScript

import { CHROME_ICONS } from '../uiAssets';
import { PlatformModalCloseButton } from './common/PlatformModalCloseButton';
import { PixelIcon } from './PixelIcon';
type PixelCloseButtonProps = {
onClick: () => void;
label?: string;
placement?: 'absolute' | 'inline';
className?: string;
};
/**
* RPG 像素风弹窗右上关闭按钮。
* 这里只保留 RPG 语义层封装,底层样式与行为统一复用共享 close button。
*/
export function PixelCloseButton({
onClick,
label = '关闭面板',
placement = 'absolute',
className = '',
}: PixelCloseButtonProps) {
return (
<PlatformModalCloseButton
label={label}
title={label}
variant="pixel"
placement={placement}
stopPropagation
onClick={() => onClick()}
className={['z-20', className].filter(Boolean).join(' ')}
icon={<PixelIcon src={CHROME_ICONS.close} className="h-4 w-4" />}
/>
);
}