This commit is contained in:
2026-04-21 18:27:46 +08:00
parent 04bff9617d
commit 4372ab5be1
358 changed files with 30788 additions and 14737 deletions

View File

@@ -0,0 +1,97 @@
import type { ReactNode } from 'react';
import type { CustomWorldProfile } from '../../types';
function SmallButton({
children,
disabled = false,
onClick,
tone = 'default',
}: {
children: ReactNode;
disabled?: boolean;
onClick: () => void;
tone?: 'default' | 'sky';
}) {
return (
<button
type="button"
onClick={onClick}
disabled={disabled}
className={`${
tone === 'sky'
? 'platform-button platform-button--primary'
: 'platform-button platform-button--ghost'
} min-h-0 rounded-full px-3 py-2 text-sm ${disabled ? 'cursor-not-allowed opacity-45' : ''}`}
>
{children}
</button>
);
}
interface RpgCreationResultActionBarProps {
editActionLabel: string;
enterWorldActionLabel: string;
isGenerating: boolean;
onContinueExpand?: () => void;
onEditSetting?: () => void;
onEnterWorld?: () => void;
onRegenerate?: () => void;
profile: CustomWorldProfile;
regenerateActionLabel: string;
publishReady: boolean;
}
export function RpgCreationResultActionBar({
editActionLabel,
enterWorldActionLabel,
isGenerating,
onContinueExpand,
onEditSetting,
onEnterWorld,
onRegenerate,
profile,
regenerateActionLabel,
publishReady,
}: RpgCreationResultActionBarProps) {
return (
<div className="mt-4 flex flex-col gap-3">
{profile.generationStatus === 'key_only' ? (
<div className="platform-banner platform-banner--warning rounded-2xl text-sm leading-6">
</div>
) : null}
<div className="flex items-center justify-end gap-3">
{onEditSetting ? (
<SmallButton onClick={onEditSetting}>{editActionLabel}</SmallButton>
) : null}
{onRegenerate ? (
<SmallButton onClick={onRegenerate} tone="sky">
{regenerateActionLabel}
</SmallButton>
) : null}
{profile.generationStatus === 'key_only' && onContinueExpand ? (
<SmallButton
onClick={onContinueExpand}
tone="sky"
disabled={isGenerating}
>
</SmallButton>
) : null}
{onEnterWorld ? (
<button
type="button"
onClick={onEnterWorld}
disabled={isGenerating || !publishReady}
className={`platform-button platform-button--primary ${isGenerating ? 'opacity-55' : ''}`}
>
{enterWorldActionLabel}
</button>
) : null}
</div>
</div>
);
}
export default RpgCreationResultActionBar;