<template>

<div :class="['ctrls', ctrlClass]">

  <div class="title">
    <div class="text">{{ roadName }}</div>
  </div>

</div>

</template>

<script lang='ts' setup>

import { direct } from '@/flash/HisDetail'
import { ASYNC_DIRECTIONS } from '@/config/dict'

// const direction = computed(() => getParams('direction'))
const ctrlClass = computed(() => direct.value ? 'lower' : 'up')
const roadName = computed(() => {
  return ASYNC_DIRECTIONS()[direct.value]?.name || ''
})

</script>

<style lang='scss' scoped>

$base-url: '@/assets/images/event/';
$car-url: '@/assets/images/cars/';

.ctrls {
  display: inline-flex;
  align-items: center;
  height: 42px;
  .title {
    color: white;
    width: 146px;
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 4px;

    .text {
      font-size: 24px;
      font-weight: 600;
    }
    .more {
      font-size: 16px;
      color: rgba(240, 245, 255, 0.95);
      display: flex;
    }
  }

  &.up {
    // margin: 0 auto;
    .title {
      background-image: url($base-url + 'arrow_lft.png');
      background-repeat: no-repeat;
      background-size: 100%;
      background-position: 0 bottom;
      .text {
        margin-left: 28px;
      }
    }
    .def-btn {
      margin-left: 5px;
    }
  }

  &.lower {
    // margin: 15px auto 0;
    .title {
      background-image: url($base-url + 'arrow_rgt.png');
      background-repeat: no-repeat;
      background-size: 100%;
      background-position: 0 bottom;
      text-align: center;
      .text {
        margin-left: 18px;
      }
    }
    .more {
      margin-right: 32px;
    }
  }
}

</style>