import React from 'react'; import { View, Text } from '@tarojs/components'; import './index.scss'; type ButtonColor = 'pri' | 'acc' | 'wrn' | 'dan'; interface ShortcutButtonProps { icon: string; label: string; color?: ButtonColor; onPress?: () => void; badge?: number; } const ShortcutButton: React.FC = ({ icon, label, color = 'pri', onPress, badge, }) => { const cls = ['shortcut-btn', `shortcut-btn--${color}`].join(' '); return ( {icon} {badge != null && badge > 0 && ( {badge > 99 ? '99+' : badge} )} {label} ); }; export default React.memo(ShortcutButton);