mirror of
https://gitlab.com/mbugroup/lti-web-client.git
synced 2026-05-25 15:55:48 +00:00
refactor(FE): Refactor PDF components to support custom styles
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
import { Text, View, StyleSheet } from '@react-pdf/renderer';
|
||||
import type { Style } from '@react-pdf/types';
|
||||
|
||||
type PdfParamBadgeProps = {
|
||||
children: React.ReactNode;
|
||||
style?: Style;
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
@@ -16,9 +18,9 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
});
|
||||
|
||||
export const PdfParamBadge = ({ children }: PdfParamBadgeProps) => {
|
||||
export const PdfParamBadge = ({ children, style }: PdfParamBadgeProps) => {
|
||||
return (
|
||||
<View style={styles.parameterBadge}>
|
||||
<View style={[styles.parameterBadge, ...(style ? [style] : [])]}>
|
||||
<Text>{children}</Text>
|
||||
</View>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user