Budibase is an open-source low-code platform for creating internal apps in minutes. Supports PostgreSQL, MySQL, MSSQL, MongoDB, Rest API, Docker, K8s 🚀
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

64 lines
1.2 KiB

<script>
import { FILE_TYPES } from "constants/backend"
export let files
export let height = "70"
export let width = "70"
</script>
<div class="file-list">
{#each files as file}
<div class="file">
{#if FILE_TYPES.IMAGE.includes(file.extension.toLowerCase())}
<img {width} {height} src={file.url} />
{:else}
<i class="ri-file-line" />
<span class="extension">.{file.extension}</span>
<span>{file.name}</span>
{/if}
</div>
{/each}
</div>
<style>
.file-list {
display: grid;
grid-auto-flow: column;
grid-gap: var(--spacing-m);
grid-template-columns: repeat(10, 1fr);
}
img {
object-fit: contain;
}
i {
font-size: 36px;
margin-bottom: var(--spacing-m);
}
.file {
position: relative;
height: 75px;
width: 75px;
border: 2px dashed var(--grey-7);
padding: var(--spacing-m);
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
.extension {
position: absolute;
top: var(--spacing-s);
left: var(--spacing-s);
font-weight: 500;
}
span {
width: 75px;
overflow: hidden;
text-overflow: ellipsis;
}
</style>