@@ -11,16 +11,10 @@ import { fileIcon } from "@/lib/utils/get-file-icon";
1111import { getPagesCount } from "@/lib/utils/get-page-number-count" ;
1212
1313const 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
2418} ;
2519
2620export default function DocumentUpload ( {
@@ -33,26 +27,39 @@ export default function DocumentUpload({
3327 const { theme, systemTheme } = useTheme ( ) ;
3428 const isLight =
3529 theme === "light" || ( theme === "system" && systemTheme === "light" ) ;
36- const { plan } = usePlan ( ) ;
30+ const { plan, trial } = usePlan ( ) ;
31+ const isFreePlan = plan === "free" ;
32+ const isTrial = ! ! trial ;
3733 const maxSize = plan === "business" || plan === "datarooms" ? 100 : 30 ;
3834 const maxNumPages = plan === "business" || plan === "datarooms" ? 500 : 100 ;
3935
4036 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+ } ,
5663 multiple : false ,
5764 maxSize : maxSize * 1024 * 1024 , // 30 MB
5865 onDropAccepted : ( acceptedFiles ) => {
@@ -151,7 +158,9 @@ export default function DocumentUpload({
151158 < p className = "text-xs leading-5 text-gray-500" >
152159 { currentFile
153160 ? "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` }
155164 </ p >
156165 </ div >
157166 </ div >
0 commit comments