MCPcopy
hub / github.com/pingdotgg/uploadthing / styleFieldToClassName

Function styleFieldToClassName

packages/shared/src/component-utils.ts:168–180  ·  view source on GitHub ↗
(
  styleField: StyleField<T> | undefined,
  args: T,
)

Source from the content-addressed store, hash-verified

166 | ((arg: Omit<CallbackArg, "__runtime">) => ElementEsque<TRuntime>);
167
168export const styleFieldToClassName = <T extends MinCallbackArg>(
169 styleField: StyleField<T> | undefined,
170 args: T,
171) => {
172 if (typeof styleField === "string") return styleField;
173 if (typeof styleField === "function") {
174 const result = styleField(args);
175
176 if (typeof result === "string") return result;
177 }
178
179 return "";
180};
181
182export const styleFieldToCssObject = <T extends MinCallbackArg>(
183 styleField: StyleField<T> | undefined,

Callers 11

UploadDropzoneFunction · 0.90
renderClearButtonFunction · 0.90
renderAllowedContentFunction · 0.90
UploadButtonFunction · 0.90
UploadDropzoneFunction · 0.90
UploadButtonFunction · 0.90
renderUploadIconFunction · 0.90
generateUploadDropzoneFunction · 0.90
renderClearButtonFunction · 0.90
renderAllowedContentFunction · 0.90
generateUploadButtonFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected