<template>
  <span
    v-if="typeof value !== 'string' || value.toString().indexOf('\n') === -1"
    :class="$style.text"
    >{{ value }}</span
  >
  <div v-else>
    <div v-for="(v, index) in value.split('\n')" :key="index">{{ v }}</div>
  </div>
</template>

<script>
import components from './_import-components/sd-form-display-text-import'

export default {
  name: 'SdFormDisplayText',
  components,
  props: {
    value: {
      type: [String, Number],
      default: undefined,
    },
  },
  data() {
    return {}
  },
  methods: {},
}
</script>

<style module lang="scss">
@use '@/common/design' as *;
.text {
  white-space: pre-wrap;
}
</style>
