frontend/app/components/notes/reblog-header.vue

41 lines
1.3 KiB
Vue
Raw Normal View History

<template>
2025-04-10 14:48:03 +02:00
<NuxtLink :href="urlAsPath">
2025-12-09 22:32:22 +01:00
<Card
class="flex-row px-2 py-1 items-center gap-2 hover:bg-muted duration-100 text-sm"
>
2026-01-09 21:47:12 +01:00
<Repeat class="size-4 text-primary" />
<Avatar
class="size-6 border"
:src="rebloggerNote.account.avatar"
:name="rebloggerNote.account.display_name"
/>
<span
class="font-semibold"
v-render-emojis="rebloggerNote.account.emojis"
>{{ rebloggerNote.account.display_name }}</span
2025-12-09 22:32:22 +01:00
>
2025-04-10 14:48:03 +02:00
{{ m.large_vivid_horse_catch() }}
</Card>
2024-11-30 16:39:02 +01:00
</NuxtLink>
</template>
<script lang="ts" setup>
import { Repeat } from "lucide-vue-next";
2025-07-16 07:48:39 +02:00
import * as m from "~~/paraglide/messages.js";
import Avatar from "../profiles/avatar.vue";
2025-04-10 14:48:03 +02:00
import { Card } from "../ui/card";
import { key } from "./provider";
// biome-ignore lint/style/noNonNullAssertion: We want an error if not provided
const { rebloggerNote } = inject(key)!;
2024-12-02 17:25:27 +01:00
if (!rebloggerNote) {
throw new Error(
"ReblogHeader must be used with a rebloggerNote in context",
);
}
const reblogAccountUrl = wrapUrl(`/@${rebloggerNote.account.acct}`);
const urlAsPath = new URL(reblogAccountUrl).pathname;
2025-04-10 14:48:03 +02:00
</script>