mirror of
https://github.com/mayswind/ezbookkeeping.git
synced 2026-05-16 07:57:33 +08:00
use for-of statements to replace for and for-in
This commit is contained in:
@@ -42,11 +42,13 @@ export function useItemIconBase(props: CommonIconProps) {
|
||||
iconId = iconId.toString();
|
||||
}
|
||||
|
||||
if (!ALL_ACCOUNT_ICONS[iconId]) {
|
||||
const iconInfo = ALL_ACCOUNT_ICONS[iconId];
|
||||
|
||||
if (!iconInfo) {
|
||||
return DEFAULT_ACCOUNT_ICON.icon;
|
||||
}
|
||||
|
||||
return ALL_ACCOUNT_ICONS[iconId].icon;
|
||||
return iconInfo.icon;
|
||||
}
|
||||
|
||||
function getCategoryIcon(iconId: string | number): string {
|
||||
@@ -54,11 +56,13 @@ export function useItemIconBase(props: CommonIconProps) {
|
||||
iconId = iconId.toString();
|
||||
}
|
||||
|
||||
if (!ALL_CATEGORY_ICONS[iconId]) {
|
||||
const iconInfo = ALL_CATEGORY_ICONS[iconId];
|
||||
|
||||
if (!iconInfo) {
|
||||
return DEFAULT_CATEGORY_ICON.icon;
|
||||
}
|
||||
|
||||
return ALL_CATEGORY_ICONS[iconId].icon;
|
||||
return iconInfo.icon;
|
||||
}
|
||||
|
||||
function getAccountIconStyle(color?: ColorValue, defaultColor?: ColorStyleValue, additionalColorAttr?: string): Record<IconItemStyleName, IconItemStyleValue> {
|
||||
|
||||
Reference in New Issue
Block a user