MCPcopy
hub / github.com/puckeditor/puck / FieldLabelInternal

Function FieldLabelInternal

packages/core/components/AutoField/FieldLabel.tsx:52–81  ·  view source on GitHub ↗
({
  children,
  icon,
  label,
  el = "label",
  readOnly,
}: FieldLabelPropsInternal)

Source from the content-addressed store, hash-verified

50};
51
52export const FieldLabelInternal = ({
53 children,
54 icon,
55 label,
56 el = "label",
57 readOnly,
58}: FieldLabelPropsInternal) => {
59 const overrides = useAppStore((s) => s.overrides);
60
61 const Wrapper = useMemo(
62 () => overrides.fieldLabel || FieldLabel,
63 [overrides]
64 );
65
66 if (!label) {
67 return <>{children}</>;
68 }
69
70 return (
71 <Wrapper
72 label={label}
73 icon={icon}
74 className={getClassName({ readOnly })}
75 readOnly={readOnly}
76 el={el}
77 >
78 {children}
79 </Wrapper>
80 );
81};
82
83export type FieldPropsInternalOptional<ValueType = any, F = Field<any>> = Omit<
84 FieldProps<F, ValueType>,

Callers

nothing calls this directly

Calls 1

useAppStoreFunction · 0.90

Tested by

no test coverage detected