fix: inputs limit to their respective file formats

This commit is contained in:
Chris Holland 2024-10-22 15:26:46 -07:00
parent 19cc3ea0d7
commit b678ac86e8
No known key found for this signature in database
GPG key ID: 68B0A864B1B0A0D2
9 changed files with 55 additions and 6 deletions

View file

@ -13,6 +13,9 @@ import { Cloud, File, Info, Loader, UploadCloud } from 'lucide-react'
import Link from 'next/link';
import React, { useEffect } from 'react'
import toast from 'react-hot-toast';
import { constructAcceptValue } from '@/lib/constants';
const SUPPORTED_FILES = constructAcceptValue(['pdf', 'docx', 'mp4', 'jpg', 'png', 'pptx', 'zip'])
export function AssignmentTaskGeneralEdit() {
const session = useLHSession() as any;
@ -242,6 +245,7 @@ function UpdateTaskRef() {
<div className="flex justify-center items-center">
<input
type="file"
accept={SUPPORTED_FILES}
id="fileInput"
style={{ display: 'none' }}
onChange={handleFileChange}
@ -255,6 +259,7 @@ function UpdateTaskRef() {
<div className="flex justify-center items-center">
<input
type="file"
accept={SUPPORTED_FILES}
id="fileInput"
style={{ display: 'none' }}
onChange={handleFileChange}