forked from zhongyidian/yx-react-template
feat: 引入 yuxiang-kit 课程组件源码与运行时
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
77742d5b02
commit
3995656175
41 files changed
+2752
No files matched your search
@@ -0,0 +1,41 @@
|
||||
import { Button } from "@/components/ui/button";
|
||||
import styles from "./GuideSpotlight.module.css";
|
||||
import type { GuideSpotlightRenderState } from "./GuideSpotlight.types";
|
||||
|
||||
export interface DefaultGuideSpotlightPanelProps {
|
||||
spotlight: GuideSpotlightRenderState;
|
||||
}
|
||||
|
||||
export function DefaultGuideSpotlightPanel({
|
||||
spotlight,
|
||||
}: DefaultGuideSpotlightPanelProps) {
|
||||
const { step, progress, status, actions, labels } = spotlight;
|
||||
|
||||
return (
|
||||
<>
|
||||
{step.title && <h2 className={styles.title}>{step.title}</h2>}
|
||||
{step.description && (
|
||||
<div className={styles.description}>{step.description}</div>
|
||||
)}
|
||||
|
||||
<div className={styles.footer}>
|
||||
<span className={styles.counter}>
|
||||
{progress.current} / {progress.total}
|
||||
</span>
|
||||
<div className={styles.actions}>
|
||||
<Button variant="ghost" size="sm" onClick={actions.skip}>
|
||||
{labels.skip}
|
||||
</Button>
|
||||
{!status.isFirst && (
|
||||
<Button variant="secondary" size="sm" onClick={actions.prev}>
|
||||
{labels.prev}
|
||||
</Button>
|
||||
)}
|
||||
<Button size="sm" onClick={actions.primary}>
|
||||
{labels.primary}
|
||||
</Button>
|
||||
</div>
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user