You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
698 B
Vue

<template>
<div class="header">
<div @click="profile">
<img
v-if="props.avatar"
class="avatar"
@click="profile"
:src="props.avatar"
alt="" />
<Icon
v-else
class="avatar"
name="fa6-solid:circle-user" />
</div>
</div>
</template>
<script setup lang="ts">
interface Props {
avatar?: string;
}
const props = defineProps<Props>();
const router = useRouter();
const profile = () => {
router.push('/profile');
};
</script>
<style scoped>
.header {
@apply bg-secondary my-3 flex h-16 w-full max-w-3xl flex-row items-center justify-center rounded-lg;
}
.avatar {
@apply bg-secondary h-12 w-12 rounded-full hover:cursor-pointer;
}
</style>