feat: Add new message bubbles (#10481)

---------

Co-authored-by: Pranav <pranavrajs@gmail.com>
This commit is contained in:
Shivam Mishra
2024-12-13 07:12:22 +05:30
committed by GitHub
parent 67e52d7d51
commit 19ff5bdd5e
53 changed files with 7781 additions and 33 deletions

View File

@@ -0,0 +1,36 @@
<script setup>
import FileIcon from './FileIcon.vue';
const files = [
{ name: 'file.7z', type: '7z' },
{ name: 'file.zip', type: 'zip' },
{ name: 'file.rar', type: 'rar' },
{ name: 'file.tar', type: 'tar' },
{ name: 'file.csv', type: 'csv' },
{ name: 'file.docx', type: 'docx' },
{ name: 'file.doc', type: 'doc' },
{ name: 'file.odt', type: 'odt' },
{ name: 'file.pdf', type: 'pdf' },
{ name: 'file.ppt', type: 'ppt' },
{ name: 'file.pptx', type: 'pptx' },
{ name: 'file.rtf', type: 'rtf' },
{ name: 'file.json', type: 'json' },
{ name: 'file.txt', type: 'txt' },
{ name: 'file.xls', type: 'xls' },
{ name: 'file.xlsx', type: 'xlsx' },
];
</script>
<template>
<Story title="Components/Icons/FileIcon">
<div class="grid grid-cols-4 gap-5">
<div
v-for="file in files"
:key="file.type"
class="flex items-center gap-2"
>
<FileIcon :file-type="file.type" class="size-6" />
<p>{{ file.name }}</p>
</div>
</div>
</Story>
</template>

View File

@@ -0,0 +1,38 @@
<script setup>
import { computed } from 'vue';
import Icon from 'next/icon/Icon.vue';
const { fileType } = defineProps({
fileType: {
type: String,
required: true,
},
});
const fileTypeIcon = computed(() => {
const fileIconMap = {
'7z': 'i-woot-file-zip',
csv: 'i-woot-file-csv',
doc: 'i-woot-file-doc',
docx: 'i-woot-file-doc',
json: 'i-woot-file-txt',
odt: 'i-woot-file-doc',
pdf: 'i-woot-file-pdf',
ppt: 'i-woot-file-ppt',
pptx: 'i-woot-file-ppt',
rar: 'i-woot-file-zip',
rtf: 'i-woot-file-doc',
tar: 'i-woot-file-zip',
txt: 'i-woot-file-txt',
xls: 'i-woot-file-xls',
xlsx: 'i-woot-file-xls',
zip: 'i-woot-file-zip',
};
return fileIconMap[fileType] || 'i-teenyicons-text-document-solid';
});
</script>
<template>
<Icon :icon="fileTypeIcon" />
</template>