fix: Resolve TypeScript errors in Button and ultravoxService
- Button.tsx: Replace `condition && style` with ternary operators to ensure array elements are always ViewStyle/TextStyle (not false) - ultravoxService.ts: Add 'in' type guard before accessing optional 'location' property on alert objects 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
parent
51d533f133
commit
b851e40f33
@ -34,8 +34,8 @@ export function Button({
|
|||||||
styles.base,
|
styles.base,
|
||||||
styles[variant],
|
styles[variant],
|
||||||
styles[`size_${size}`],
|
styles[`size_${size}`],
|
||||||
fullWidth && styles.fullWidth,
|
fullWidth ? styles.fullWidth : {},
|
||||||
isDisabled && styles.disabled,
|
isDisabled ? styles.disabled : {},
|
||||||
style as ViewStyle,
|
style as ViewStyle,
|
||||||
];
|
];
|
||||||
|
|
||||||
@ -43,7 +43,7 @@ export function Button({
|
|||||||
styles.text,
|
styles.text,
|
||||||
styles[`text_${variant}`],
|
styles[`text_${variant}`],
|
||||||
styles[`text_${size}`],
|
styles[`text_${size}`],
|
||||||
isDisabled && styles.textDisabled,
|
isDisabled ? styles.textDisabled : {},
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
|||||||
@ -88,7 +88,7 @@ CURRENT STATUS (Today - ${todayData?.day || 'Wednesday'}):
|
|||||||
const emoji = alert.severity === 'critical' ? '🔴' : alert.severity === 'high' ? '🟠' : alert.severity === 'medium' ? '🟡' : '🟢';
|
const emoji = alert.severity === 'critical' ? '🔴' : alert.severity === 'high' ? '🟠' : alert.severity === 'medium' ? '🟡' : '🟢';
|
||||||
context += ` ${emoji} ${alert.type.replace(/_/g, ' ').toUpperCase()} at ${alert.time}`;
|
context += ` ${emoji} ${alert.type.replace(/_/g, ' ').toUpperCase()} at ${alert.time}`;
|
||||||
if (alert.note) context += ` - ${alert.note}`;
|
if (alert.note) context += ` - ${alert.note}`;
|
||||||
if (alert.location) context += ` (${alert.location})`;
|
if ('location' in alert && alert.location) context += ` (${alert.location})`;
|
||||||
context += '\n';
|
context += '\n';
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user