mirror of
https://github.com/tomru/pdfer.git
synced 2026-03-03 06:27:19 +01:00
make client own package (using create-react-app)
This commit is contained in:
30
client/src/Preview.js
Normal file
30
client/src/Preview.js
Normal file
@@ -0,0 +1,30 @@
|
||||
import React from 'react';
|
||||
|
||||
export default props => {
|
||||
if (props.pdfIsLoading) {
|
||||
return (
|
||||
<div>Lade...</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (props.pdfError) {
|
||||
return (
|
||||
<div>{props.pdfError}</div>
|
||||
);
|
||||
}
|
||||
|
||||
if (!props.pdfUrl) {
|
||||
return (
|
||||
<div>Knopf drücken dann gibts hier was zu sehen!</div>
|
||||
);
|
||||
}
|
||||
|
||||
const styles = {
|
||||
width: '700px',
|
||||
height: '1050px'
|
||||
};
|
||||
|
||||
return (
|
||||
<embed src={props.pdfUrl} style={styles} type="application/pdf" />
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user