compote-ui
Version:
An opinionated UI component library for Svelte, built on top of [Ark UI](https://ark-ui.com) with additional components and features not available in the core Ark UI library.
19 lines (18 loc) • 576 B
JavaScript
const fileTypeMap = {
excel: 'application/vnd.ms-excel, application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
word: 'application/msword, application/vnd.openxmlformats-officedocument.wordprocessingml.document',
image: 'image/*',
pdf: 'application/pdf',
video: 'video/*',
audio: 'audio/*',
text: 'text/plain',
csv: 'text/csv'
};
export const getAcceptAttribute = (fileType) => {
if (!fileType)
return undefined;
const accept = fileTypeMap[fileType];
if (!accept)
return undefined;
return accept;
};