import { createElement, useState, render } from 'rax';
import DriverUniversal from 'driver-universal';
import { Step } from '@alifd/meet';
import View from 'rax-view';
import Text from 'rax-text';
import '../../components/index.css';

const StepDemo = () => {
  const [curStep, setCurStep] = useState(-1);

  const handleChange = (step) => {
    setCurStep(step);
  };

  const handleClick = (step) => {
    console.log(`${step} clicked`);
  };

  return (
    <View>
      <Text className="demo-title">dot</Text>
      <View className="demo-content">
        <Step shape="dot" current={curStep} onChange={handleChange}>
          <Step.Item title={'步骤 1'} content="描述文案" onClick={handleClick} />
          <Step.Item title={'步骤 2'} content="描述文案" onClick={handleClick} />
          <Step.Item title={'步骤 3'} content="描述文案" onClick={handleClick} />
        </Step>
      </View>
      <View className="demo-content">
        <Step shape="dot" current={curStep} direction="ver" onChange={handleChange}>
          <Step.Item title={'步骤 1'} content="描述文案" />
          <Step.Item title={'步骤 2'} content="描述文案" />
          <Step.Item title={'步骤 3'} content="描述文案" />
        </Step>
      </View>
      <Text className="demo-title">circle</Text>
      <View className="demo-content">
        <Step shape="circle" current={curStep} onChange={handleChange}>
          <Step.Item title={'步骤 1'} content="描述文案" />
          <Step.Item title={'步骤 2'} content="描述文案" />
          <Step.Item title={'步骤 3'} content="描述文案" />
        </Step>
      </View>
      <View className="demo-content">
        <Step shape="circle" current={curStep} direction="ver" onChange={handleChange}>
          <Step.Item title={'步骤 1'} content="描述文案" />
          <Step.Item title={'步骤 2'} content="描述文案" />
          <Step.Item title={'步骤 3'} content="描述文案" />
        </Step>
      </View>
      <Text className="demo-title">arrow</Text>
      <View className="demo-content">
        <Step shape="arrow" current={curStep} onChange={handleChange}>
          <Step.Item title={'步骤 1'} content="描述文案" />
          <Step.Item title={'步骤 2'} content="描述文案" />
          <Step.Item title={'步骤 3'} content="描述文案" />
        </Step>
      </View>
    </View>
  );
};
// render(<StepDemo />, null, { driver: DriverUniversal });
 export default StepDemo 