import React from 'react'; import { View, Text } from '@tarojs/components'; import './index.scss'; type AlertColor = 'pri' | 'wrn'; interface TodoAlertProps { icon?: string; title: string; subtitle?: string; color?: AlertColor; onPress?: () => void; } const TodoAlert: React.FC = ({ icon, title, subtitle, color = 'pri', onPress, }) => { const cls = ['todo-alert', `todo-alert--${color}`].join(' '); return ( {icon && ( {icon} )} {title} {subtitle && {subtitle}} ); }; export default React.memo(TodoAlert);