Skip to content

Commit 28eba9e

Browse files
authored
fix: Dynamically display accepted file types in FileAttachment (#1145)
1 parent 7136e03 commit 28eba9e

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

apps/studio/src/components/PageEditor/FileAttachment.tsx

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,7 @@ import { FormControl, Skeleton, Text } from "@chakra-ui/react"
44
import { Attachment } from "@opengovsg/design-system-react"
55

66
import { useImageUpload } from "~/features/editing-experience/components/form-builder/hooks/useImage"
7-
import {
8-
ACCEPTED_FILE_TYPES_MESSAGE,
9-
ONE_MB_IN_BYTES,
10-
} from "~/features/editing-experience/components/form-builder/renderers/controls/constants"
7+
import { ONE_MB_IN_BYTES } from "~/features/editing-experience/components/form-builder/renderers/controls/constants"
118
import { useUploadAssetMutation } from "~/hooks/useUploadAssetMutation"
129
import { getPresignedPutUrlSchema } from "~/schemas/asset"
1310

@@ -83,7 +80,7 @@ export const FileAttachment = ({
8380
<Text textStyle="body-2" textColor="base.content.medium" pt="0.5rem">
8481
{`Maximum file size: ${maxSizeInBytes / ONE_MB_IN_BYTES} MB`}
8582
<br />
86-
{`Accepted file types: ${ACCEPTED_FILE_TYPES_MESSAGE}`}
83+
{`Accepted file types: ${Object.keys(acceptedFileTypes).join(", ")}`}
8784
</Text>
8885
</FormControl>
8986
)

0 commit comments

Comments
 (0)