<template>
  <section class="sv-route-wrapper">
    <div class="route-name">{{from}}</div>
    <div class="route-arrow" :class="{'double': double}">
      <img :src="signleDouble" class="image" v-if="double">
      <img :src="signleArrow" class="image" v-else/>
    </div>
    <div class="route-name">{{to}}</div>
  </section>
</template>

<script>
  import signleArrow from './route-arrow.png'
  import signleDouble from './route-double.png'
  export default {
    name: 'svRoute',
    data () {
      return {
        signleArrow,
        signleDouble
      }
    },
    props: {
      from: String,
      to: String,
      double: {
        type: Boolean,
        default: false
      }
    }
  }
</script>

<style lang="scss" rel="stylesheet/scss">
  .sv-route-wrapper{
    display: flex;
    align-items: center;
    .route-name{
      max-width: 46%;
      word-break: break-all;
      font-size: pxToRem(30);
    }
    .route-arrow{
      display: flex;
      justify-content: center;
      align-items: center;
      width: pxToRem(48);
      height: pxToRem(11);
      margin: pxToRem(0 12);
      &.double{
        height: pxToRem(28);
      }
      .image{
        width: 100%;
        height: 100%;
      }
    }
  }
</style>
