<commit_before><template>
    <div class="text-answer-feed-card">
        <div class="feed-card-header">
            <div>
                <h2 class="feed-card-title">
                    <span class="answer-type"
                      v-if="!hideQuestion">
                    <span>{{$t('common:feedCard.answerType.textWithQuestion1')}} </span>
                    <span class="creator-name" @click="goToProfile()">{{creator.name}} </span>
                    <span>{{$t('common:feedCard.answerType.textWithQuestion2')}} </span>
                    </span>
                    <span class="answer-type" v-else>{{$t('common:feedCard.answerType.text')}}</span>
                    <span class="card-header-link">
                    <nuxt-link :to="{name: 'question-questionId-slug',
                            params: {questionId: answer.questionId, slug: answer.questionSlug},
                            query: {answerId: answer.answerId}}"> {{answer.question}}
                    </nuxt-link></span>
                </h2>
                <div class="secondary-text">{{answer.created | formatRelativeTimesAgo}}</div>
            </div>
            <v-spacer></v-spacer>
            <slot name="feedMenu"></slot>
        </div>
        <expand-text :expand-text="answer.answerHtml" class="answer-description" itemprop="text">
        </expand-text>
        <slot name="footer"></slot>
    </div>
</template>

<script>
    import ExpandText from '~/components/common/text/Expand.vue'

    export default {
        props: ['answer', 'hideQuestion', 'creator'],
        components: {ExpandText},
        methods: {
            goToProfile() {
                if (this.creator.isLoggedInUser) {
                    this.$router.push({name: 'user'});
                } else {
                    this.$router.push({
                        name: 'user-userId-slug', params: {userId: this.creator.userId, slug: this.creator.slug}
                    })
                }
            }
        }
    }
</script>

<style lang="scss">
    .text-answer-feed-card {
        .answer-description {
            margin-bottom: 16px;
        }
        .question-to-answer-container {
            margin-bottom: 8px;
        }
        .creator-name {
            color: $primary-color;
            font-weight: 400;
            cursor: pointer;
        }
        :hover.creator-name {
            text-decoration: underline;
        }
    }
</style>
<commit_msg>Bugfix: disable link when no questionId is used.<commit_after><template>
    <div class="text-answer-feed-card">
        <div class="feed-card-header">
            <div>
                <h2 class="feed-card-title">
                    <span class="answer-type"
                      v-if="!hideQuestion">
                    <span>{{$t('common:feedCard.answerType.textWithQuestion1')}} </span>
                    <span class="creator-name" @click="goToProfile()">{{creator.name}} </span>
                    <span>{{$t('common:feedCard.answerType.textWithQuestion2')}} </span>
                    </span>
                    <span class="answer-type" v-else>{{$t('common:feedCard.answerType.text')}}</span>
                    <span class="card-header-link" v-if="answer.questionId">
                    <nuxt-link :to="{name: 'question-questionId-slug',
                            params: {questionId: answer.questionId, slug: answer.questionSlug},
                            query: {answerId: answer.answerId}}"> {{answer.question}}
                    </nuxt-link></span>
                </h2>
                <div class="secondary-text">{{answer.created | formatRelativeTimesAgo}}</div>
            </div>
            <v-spacer></v-spacer>
            <slot name="feedMenu"></slot>
        </div>
        <expand-text :expand-text="answer.answerHtml" class="answer-description" itemprop="text">
        </expand-text>
        <slot name="footer"></slot>
    </div>
</template>

<script>
    import ExpandText from '~/components/common/text/Expand.vue'

    export default {
        props: ['answer', 'hideQuestion', 'creator'],
        components: {ExpandText},
        methods: {
            goToProfile() {
                if (this.creator.isLoggedInUser) {
                    this.$router.push({name: 'user'});
                } else {
                    this.$router.push({
                        name: 'user-userId-slug', params: {userId: this.creator.userId, slug: this.creator.slug}
                    })
                }
            }
        }
    }
</script>

<style lang="scss">
    .text-answer-feed-card {
        .answer-description {
            margin-bottom: 16px;
        }
        .question-to-answer-container {
            margin-bottom: 8px;
        }
        .creator-name {
            color: $primary-color;
            font-weight: 400;
            cursor: pointer;
        }
        :hover.creator-name {
            text-decoration: underline;
        }
    }
</style>

{'fraction_non_alphanumeric': 0.1510689794271884, 'fraction_numerical': 0.004033884630899556, 'mean_word_length': 1.543076923076923, 'pattern_counts': {'":': 0, '<': 79, '<?xml version=': 0, '>': 79, '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': '917649', 'n_tokens_mistral': 1441, 'n_tokens_neox': 1371, 'n_words': 218}