@@ -11,16 +11,10 @@ import { fileIcon } from "@/lib/utils/get-file-icon";
11
11
import { getPagesCount } from "@/lib/utils/get-page-number-count" ;
12
12
13
13
const fileSizeLimits : { [ key : string ] : number } = {
14
- "application/vnd.ms-excel" : 30 , // 30 MB
15
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" : 30 , // 30 MB
16
- "application/vnd.oasis.opendocument.spreadsheet" : 30 , // 30 MB
17
- "application/vnd.ms-powerpoint" : 30 , // 30 MB
18
- "application/vnd.openxmlformats-officedocument.presentationml.presentation" : 30 , // 30 MB
19
- "application/vnd.oasis.opendocument.presentation" : 30 , // 30 MB
20
- "application/msword" : 30 , // 30 MB
21
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document" : 30 , // 30 MB
22
- "application/vnd.oasis.opendocument.text" : 30 , // 30 MB
23
- "text/csv" : 30 , // 30 MB
14
+ "application/vnd.ms-excel" : 40 , // 40 MB
15
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" : 40 , // 40 MB
16
+ "application/vnd.oasis.opendocument.spreadsheet" : 40 , // 40 MB
17
+ "text/csv" : 40 , // 40 MB
24
18
} ;
25
19
26
20
export default function DocumentUpload ( {
@@ -33,26 +27,39 @@ export default function DocumentUpload({
33
27
const { theme, systemTheme } = useTheme ( ) ;
34
28
const isLight =
35
29
theme === "light" || ( theme === "system" && systemTheme === "light" ) ;
36
- const { plan } = usePlan ( ) ;
30
+ const { plan, trial } = usePlan ( ) ;
31
+ const isFreePlan = plan === "free" ;
32
+ const isTrial = ! ! trial ;
37
33
const maxSize = plan === "business" || plan === "datarooms" ? 100 : 30 ;
38
34
const maxNumPages = plan === "business" || plan === "datarooms" ? 500 : 100 ;
39
35
40
36
const { getRootProps, getInputProps } = useDropzone ( {
41
- accept : {
42
- "application/pdf" : [ ] , // ".pdf"
43
- "application/vnd.ms-excel" : [ ] , // ".xls"
44
- "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" : [ ] , // ".xlsx"
45
- "text/csv" : [ ] , // ".csv"
46
- "application/vnd.oasis.opendocument.spreadsheet" : [ ] , // ".ods"
47
- "application/vnd.ms-powerpoint" : [ ] , // ".ppt"
48
- "application/vnd.openxmlformats-officedocument.presentationml.presentation" :
49
- [ ] , // ".pptx"
50
- "application/vnd.oasis.opendocument.presentation" : [ ] , // ".odp"
51
- "application/msword" : [ ] , // ".doc"
52
- "application/vnd.openxmlformats-officedocument.wordprocessingml.document" :
53
- [ ] , // ".docx"
54
- "application/vnd.oasis.opendocument.text" : [ ] , // ".odt"
55
- } ,
37
+ accept :
38
+ isFreePlan && ! isTrial
39
+ ? {
40
+ "application/pdf" : [ ] , // ".pdf"
41
+ "application/vnd.ms-excel" : [ ] , // ".xls"
42
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" :
43
+ [ ] , // ".xlsx"
44
+ "text/csv" : [ ] , // ".csv"
45
+ "application/vnd.oasis.opendocument.spreadsheet" : [ ] , // ".ods"
46
+ }
47
+ : {
48
+ "application/pdf" : [ ] , // ".pdf"
49
+ "application/vnd.ms-excel" : [ ] , // ".xls"
50
+ "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" :
51
+ [ ] , // ".xlsx"
52
+ "text/csv" : [ ] , // ".csv"
53
+ "application/vnd.oasis.opendocument.spreadsheet" : [ ] , // ".ods"
54
+ "application/vnd.ms-powerpoint" : [ ] , // ".ppt"
55
+ "application/vnd.openxmlformats-officedocument.presentationml.presentation" :
56
+ [ ] , // ".pptx"
57
+ "application/vnd.oasis.opendocument.presentation" : [ ] , // ".odp"
58
+ "application/msword" : [ ] , // ".doc"
59
+ "application/vnd.openxmlformats-officedocument.wordprocessingml.document" :
60
+ [ ] , // ".docx"
61
+ "application/vnd.oasis.opendocument.text" : [ ] , // ".odt"
62
+ } ,
56
63
multiple : false ,
57
64
maxSize : maxSize * 1024 * 1024 , // 30 MB
58
65
onDropAccepted : ( acceptedFiles ) => {
@@ -151,7 +158,9 @@ export default function DocumentUpload({
151
158
< p className = "text-xs leading-5 text-gray-500" >
152
159
{ currentFile
153
160
? "Replace file?"
154
- : `Only *.xls, *.xlsx, *.csv, *.ods, *.pdf & ${ maxSize } MB limit` }
161
+ : isFreePlan && ! isTrial
162
+ ? `Only *.pdf, *.xls, *.xlsx, *.csv, *.ods & ${ maxSize } MB limit`
163
+ : `Only *.pdf, *.pptx, *.docx, *.xlsx, *.xls, *.csv, *.ods, *.ppt, *.odp, *.doc, *.odt & ${ maxSize } MB limit` }
155
164
</ p >
156
165
</ div >
157
166
</ div >
0 commit comments