Advertisement
Guest User

Untitled

a guest
Oct 23rd, 2019
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. const DOCUMENT_FORMS = {
  2. "pay_application": PayApplicationForm,
  3. "invoice": InvoiceForm,
  4. ...
  5. }
  6.  
  7. const DocumentViewer = (props) => {
  8. const { document } = props;
  9.  
  10. const DocumentForm = DOCUMENT_FORMS[document.type];
  11.  
  12. const fileViewHeader = (
  13. <Pane padding={16} display="flex" justifyContent="space-between">
  14. <Pane>
  15. <Text size={600}>Boulding Creek Draw 7 Uploads</Text>
  16. </Pane>
  17.  
  18. <Pane>
  19. <Button>Next</Button>
  20. ...
  21. </Pane>
  22. </Pane>
  23. );
  24.  
  25. const fileViewSidebar = (
  26. ...
  27. );
  28.  
  29. return (
  30. <FileViewer
  31. header={fileViewHeader}
  32. sidebar={fileViewSidebar}
  33. previewFileUrl={document.file.url}
  34. previewFileType={document.file.type}
  35. >
  36. <DocumentForm {...props} />
  37. </FileViewer>
  38. )
  39. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement