Initial version of PDF export

This commit is contained in:
Joao Ramos
2023-12-28 23:41:21 +00:00
parent 5447c89da4
commit 0b6a66b12d
6 changed files with 670 additions and 6 deletions

View File

@@ -0,0 +1,51 @@
import React from "react";
import { View, StyleSheet } from "@react-pdf/renderer";
const styles = StyleSheet.create({
progressBar: {
borderRadius: 16,
overflow: "hidden",
},
progressBarPerc: {
height: "100%",
zIndex: 1,
},
});
interface Props {
width: number;
height: number;
backgroundColor: string;
progressColor: string;
percentage: number;
}
const ProgressBar = ({
width,
height,
backgroundColor,
progressColor,
percentage,
}: Props) => {
return (
<View
style={[
{
width,
height,
backgroundColor,
},
styles.progressBar,
]}
>
<View
style={[
{ width: `${percentage}px`, backgroundColor: progressColor },
styles.progressBarPerc,
]}
></View>
</View>
);
};
export default ProgressBar;