<commit_before><template>
  <div :class="style[baseClass]">
    <p
      v-if="summary"
      :class="style[summaryClass]"
    >
      {{ summary }}
    </p>
    <cite
      v-if="credit"
      :class="style[citeClass]"
    >
      {{ credit }}
    </cite>
  </div>
</template>

<script>

import { defineComponent, useCssModule } from 'vue';

export default defineComponent({
  name: 'CdrCaption',
  props: {
    summary: String,
    credit: String,
  },
  setup() {
    return {
      style: useCssModule(),
      baseClass: 'cdr-caption',
      summaryClass: 'cdr-caption__summary',
      citeClass: 'cdr-caption__cite',
    };
  },
});
</script>

<style lang="scss" module src="./styles/CdrCaption.module.scss">
</style>
<commit_msg>refactor(script setup): refactor caption, moving script block to top<commit_after><script setup>

import { 
  defineComponent, 
  useCssModule 
} from 'vue';
import { buildClass } from '../../utils/buildClass';

const props = defineProps({
  summary: {
    type: String,
  },
  credit: {
    type: String,
  },
});

const baseClass = 'cdr-caption';
const style = useCssModule();
const summaryClass = 'cdr-caption__summary';
const citeClass = 'cdr-caption__cite';

</script>

<template>
  <div :class="style[baseClass]">
    <p
      v-if="summary"
      :class="style[summaryClass]"
    >
      {{ summary }}
    </p>
    <cite
      v-if="credit"
      :class="style[citeClass]"
    >
      {{ credit }}
    </cite>
  </div>
</template>

<style lang="scss" module src="./styles/CdrCaption.module.scss">
</style>

{'fraction_non_alphanumeric': 0.171078114912847, 'fraction_numerical': 0.0, 'mean_word_length': 2.934010152284264, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6630582', 'n_tokens_mistral': 546, 'n_tokens_neox': 535, 'n_words': 108}