Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
15 lines
600 B
Plaintext
15 lines
600 B
Plaintext
import { isValidReactElement } from './isValidReactElement.js';
|
|
export const hasOptionLabelJSXElement = cellClientProps => {
|
|
const {
|
|
cellData,
|
|
field
|
|
} = cellClientProps;
|
|
if ((field?.type === 'select' || field?.type == 'radio') && Array.isArray(field?.options)) {
|
|
const matchingOption = field.options.find(option => typeof option === 'object' && option.value === cellData);
|
|
if (matchingOption && typeof matchingOption === 'object' && isValidReactElement(matchingOption.label)) {
|
|
return true;
|
|
}
|
|
}
|
|
return false;
|
|
};
|
|
//# sourceMappingURL=hasOptionLabelJSXElement.js.map |