challenge-vtex-io-henrique-.../react/components/PixCustomInstallments/_ComponentsFunctions.ts

14 lines
222 B
TypeScript

export const sanatizeColor = (color: string) => {
if (color) {
const [first] = color.split(" ");
if (first.indexOf("c-") === 0) {
return first;
}
return "c-on-base";
}
return "c-on-base";
};