<template>
    <Mfm
        :class="$style.root"
        :mm="magMaybeProperty(user, 'display_name_mm')"
        :text="magTransUsername(user)"
        :plain="true"
        :nowrap="nowrap"
        :custom-emojis="user.emojis"
    />
</template>

<script lang="ts" setup>
import * as misskey from "calckey-js";
import { packed } from "magnetar-common";
import { magMaybeProperty, magTransUsername } from "@/scripts-mag/mag-util";

const props = withDefaults(
    defineProps<{
        user: packed.PackUserBase | misskey.entities.User;
        nowrap?: boolean;
    }>(),
    {
        nowrap: true,
    },
);
</script>

<style lang="scss" module>
.root {
    unicode-bidi: isolate;
}
</style>
