Rewind renders most of the data

This commit is contained in:
2025-12-27 02:22:19 +08:00
parent df44c4525e
commit 9d6eb5c378
8 changed files with 695 additions and 327 deletions

View File

@@ -0,0 +1,41 @@
<template>
<n-card>
<div class="flex flex-col justify-center gap-4">
<img
v-if="userBackground"
:src="userBackground"
style="aspect-ratio: 16/7"
class="rounded-xl"
/>
<div class="flex items-center gap-4">
<n-avatar :src="userPicture" />
<div class="grow">
<div class="font-bold text-lg">{{ data.nick }}</div>
<div class="text-sm opacity-80">@{{ data.name }}</div>
</div>
<div><slot name="suffix" /></div>
</div>
</div>
</n-card>
</template>
<script setup lang="ts">
import type { SnAccount } from "~/types/api"
const props = defineProps<{ data: SnAccount }>()
const _ = defineSlots<{ suffix(): unknown }>()
const apiBase = useSolarNetworkUrl()
const userPicture = computed(() => {
return props.data.profile.picture
? `${apiBase}/drive/files/${props.data.profile.picture.id}`
: undefined
})
const userBackground = computed(() => {
return props.data.profile.background
? `${apiBase}/drive/files/${props.data.profile.background.id}`
: undefined
})
</script>