import { Steps, StepItem } from 'tvu-react-pilot'

const Surface = ({ children }: any) => (
  <div style={{ background: 'var(--bg-layer1)', padding: 20, display: 'flex', gap: 24, flexWrap: 'wrap', alignItems: 'flex-start', borderRadius: 8 }}>
    {children}
  </div>
)

export const Horizontal = () => (
  <Surface>
    <div style={{ width: 380 }}>
      <Steps current={1} direction="horizontal" stepStyle="number">
        <StepItem index={1} state="completed" stepStyle="number" direction="horizontal" title="Source" description="Connected" showTrailingConnector />
        <StepItem index={2} state="active" stepStyle="number" direction="horizontal" title="Encode" description="In progress" showLeadingConnector showTrailingConnector />
        <StepItem index={3} state="pending" stepStyle="number" direction="horizontal" title="Publish" description="Pending" showLeadingConnector />
      </Steps>
    </div>
  </Surface>
)

export const Vertical = () => (
  <Surface>
    <div style={{ width: 240 }}>
      <Steps current={1} direction="vertical" stepStyle="number">
        <StepItem index={1} state="completed" stepStyle="number" direction="vertical" title="Source" description="Connected" showTrailingConnector />
        <StepItem index={2} state="active" stepStyle="number" direction="vertical" title="Encode" description="In progress" showLeadingConnector showTrailingConnector />
        <StepItem index={3} state="pending" stepStyle="number" direction="vertical" title="Publish" description="Pending" showLeadingConnector />
      </Steps>
    </div>
  </Surface>
)

export const IconStyle = () => (
  <Surface>
    <div style={{ width: 380 }}>
      <Steps current={2} direction="horizontal" stepStyle="icon">
        <StepItem index={1} state="completed" stepStyle="icon" direction="horizontal" title="Source" description="Connected" showTrailingConnector />
        <StepItem index={2} state="completed" stepStyle="icon" direction="horizontal" title="Encode" description="Done" showLeadingConnector showTrailingConnector />
        <StepItem index={3} state="active" stepStyle="icon" direction="horizontal" title="Publish" description="Streaming" showLeadingConnector />
      </Steps>
    </div>
  </Surface>
)
