Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const getTokensByTheme = (theme: ThemeVariants, props: TokensListProps): TokenCategory[] => {
let tokens = [] as TokenCategory[];
if (theme === ThemeVariants.CONSOLE) {
if (props.consoleTokens != null) {
// eslint-disable-next-line prefer-destructuring
tokens = props.consoleTokens[0].node.tokens;
}
}
if (theme === ThemeVariants.SENDGRID) {
if (props.sendgridTokens != null) {
// eslint-disable-next-line prefer-destructuring
tokens = props.sendgridTokens[0].node.tokens;
}
}
if (theme === ThemeVariants.DEFAULT) {
if (props.defaultTokens != null) {
// eslint-disable-next-line prefer-destructuring
tokens = props.defaultTokens[0].node.tokens;
}
}
return tokens;
};
onChange={handleChange}
type="radio"
value={ThemeVariants.CONSOLE}
/>
Console
SendGrid
Paste
);
};