import { Box, Text, Image } from "@chakra-ui/react"; import { defineComponent } from "@qorebase/app-component"; import Barcode from "react-barcode"; export default defineComponent({ name: "Barcode Generator", type: "record", icon: "Barcode", group: "media", display: "block", defaultProps: { title: "Barcode Generator", description: "Description here", code: "QoreApp", displayCode: false, style: "ghost", format: "CODE128", }, propDefinition: { title: { group: "Design", type: "expression", options: {} }, description: { group: "Design", type: "expression", options: {}, }, code: { group: "Design", type: "expression", options: {} }, displayCode: { group: "Design", type: "boolean", options: { format: "boolean" }, }, style: { group: "Design", type: "string", options: { format: "select", options: [ ...["ghost", "solid"].map((item) => ({ label: item, value: item, })), ], }, }, format: { group: "Design", type: "string", options: { format: "select", options: [ { label: "CODE 128", value: "CODE128", }, // { // label: "EAN 13", // value: "EAN13", // }, // { // label: "EAN 8", // value: "EAN8", // }, { label: "CODE 39", value: "CODE39", }, // { // label: "CODABAR", // value: "CODABAR", // }, // { // label: "UPC", // value: "UPC", // }, ], }, }, }, Component: (props) => { const title = props.hooks.useEvaluate(props.properties.title); const desc = props.hooks.useEvaluate(props.properties.description); const code = props.hooks.useEvaluate(props.properties.code); const format = props.hooks.useEvaluate(props.properties.format); return ( {props.properties.style === "solid" && ( )} {title} {desc} {code || "QoreApp"} ); }, });