feat: setup instagram

This commit is contained in:
Shivam Mishra
2024-12-05 15:08:37 +05:30
parent 68f02e06b7
commit 26b5c2c136
5 changed files with 260 additions and 237 deletions
@@ -29,12 +29,19 @@ const props = defineProps({
},
});
const emit = defineEmits(['error']);
const attachment = computed(() => {
return props.attachments[0];
});
const hasError = ref(false);
const handleError = () => {
hasError.value = true;
emit('error');
};
const downloadAttachment = async () => {
const response = await fetch(attachment.value.dataUrl);
const blob = await response.blob();
@@ -51,7 +58,7 @@ const downloadAttachment = async () => {
<template>
<BaseBubble class="overflow-hidden relative group">
<img :src="attachment.thumbUrl" @click="onClick" @error="hasError = true" />
<img :src="attachment.thumbUrl" @click="onClick" @error="handleError" />
<div
class="inset-0 p-2 absolute bg-gradient-to-tl from-n-slate-12/30 dark:from-n-slate-1/50 via-transparent to-transparent hidden group-hover:flex items-end justify-end gap-1.5"
>