refactor(FE): Refactor PDF components to support custom styles

This commit is contained in:
rstubryan
2026-02-10 14:00:28 +07:00
parent 2af83bed8a
commit 59eb781a22
3 changed files with 29 additions and 23 deletions
@@ -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>
);