import { For, Show } from "solid-js"; import { Text } from "../../Typography/Text"; import { Icon } from "../../Icon"; import { Button } from "../../Button"; import { Progress } from "../../Progress"; export function List (props: any) { const format = (file: any) => { const format = file.name.split('.').pop().toLocaleLowerCase() || ''; let type = 'file-text'; if (['gif','jpg','jpeg','png','bmp','webp'].indexOf(format) > -1) { type = 'image'; } if (['mp4','m3u8','rmvb','avi','swf','3gp','mkv','flv'].indexOf(format) > -1) { type = 'film1'; } if (['mp3','wav','wma','ogg','aac','flac'].indexOf(format) > -1) { type = 'music'; } return type; } const formatSize = (size: number) => { if (size < 1024) { return size + 'B'; } if (size < 1024 * 1024) { return Math.round(size / 1024 * 10) / 10 + 'KB'; } if (size < 1024 * 1024 * 1024) { return Math.round(size / 1024 / 1024 * 10) / 10 + 'MB'; } if (size < 1024 * 1024 * 1024 * 1024) { return Math.round(size / 1024 / 1024 / 1024 * 10) / 10 + 'GB'; } } return }