<template>
  <div class="h-cell flex-sb" @click="onLink">
    <div class="title">{{ title }}</div>
    <div v-if="value">{{ value }}</div>
    <h-img width="0.3rem" height="0.45rem" src="base/icon_jiantou.png" />
  </div>
</template>

<script setup lang="ts">
import { useRouter } from "vue-router";
const router = useRouter();
const props = defineProps({
  value: { type: String, default: "" },
  title: { type: String, default: "" },
  path: { type: String, default: "" },
  isLink: { type: Boolean, default: true },
});

const onLink = () => {
  if (props.isLink) {
    router.push(props.path);
  }
};
</script>

<style lang="scss" scoped>
.h-cell {
  margin: 0.2rem 0;
  padding: 0.45rem 0.2rem;
  background: linear-gradient(to right, #262b31, #1c3236, #184039, #1d493c);
  border-radius: 0.25rem;
  --van-cell-vertical-padding: 0.36rem;
  --van-cell-text-color: #62c194;
  --van-cell-value-color: #62c194;
  font-size: 0.35rem;
  .title {
    font-weight: 500;
    color: #62c194;
  }
}
</style>
