Skip to content

Commit e5800be

Browse files
committed
[NEB-245] Limit image format types for upload
1 parent a3a4bf4 commit e5800be

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

apps/dashboard/src/@/components/ui/image-upload-button.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ interface ImageUploadProps {
1111
variant?: React.ComponentProps<typeof Button>["variant"];
1212
className?: string;
1313
multiple?: boolean;
14+
accept: string;
1415
}
1516

1617
export function ImageUploadButton(props: ImageUploadProps) {
@@ -34,7 +35,7 @@ export function ImageUploadButton(props: ImageUploadProps) {
3435
ref={fileInputRef}
3536
type="file"
3637
multiple={props.multiple}
37-
accept="image/*"
38+
accept={props.accept}
3839
onChange={handleFileChange}
3940
className="hidden"
4041
aria-label="Upload image"

apps/dashboard/src/app/nebula-app/(app)/components/ChatBar.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,7 @@ export function ChatBar(props: {
254254
<ImageUploadButton
255255
multiple
256256
value={undefined}
257+
accept="image/jpeg,image/png,image/webp"
257258
onChange={(files) => {
258259
const totalFiles = files.length + images.length;
259260

0 commit comments

Comments
 (0)