import React from "react"; import z from "zod"; import { View } from "@react-pdf/renderer"; import { defineComponent } from "../define-component.js"; import { iconComponent } from "./icon.js"; export const textWithIconComponent = defineComponent({ name: "textWithIcon", schema: z.object({}), additionalProps: z.object({ icon: z.string().optional(), suite: z.string().optional(), children: z.any().nullish(), right: z.boolean().nullish(), }), component: ({ icon, suite, children, right, styles, getComponent }) => { const Icon = getComponent(iconComponent); return ( {right && {children}} {icon && ( )} {!right && {children}} ); }, defaultStyles: { container: { display: "flex", flexDirection: "row", alignItems: "center", gap: "4pt", }, text: {}, icon: {}, } as const, });