feat: refine tiangong flows and integrate profile avatars
This commit is contained in:
1 parent
4608dbd5cf
commit
5be2ca6b50
65 files changed
+2099
-532
No files matched your search
@@ -0,0 +1,17 @@
|
||||
import type { ElementName, FiveElementReport } from './fiveElements'
|
||||
|
||||
export const elementIcons: Record<ElementName, { kind: string; label: string; color: string }> = {
|
||||
木: { kind: 'wood', label: '木', color: '#409d61' },
|
||||
火: { kind: 'fire', label: '火', color: '#e66a49' },
|
||||
土: { kind: 'earth', label: '土', color: '#ac754d' },
|
||||
金: { kind: 'metal', label: '金', color: '#c69324' },
|
||||
水: { kind: 'water', label: '水', color: '#369fc6' }
|
||||
}
|
||||
|
||||
// The entry represents the day master's element, not the largest percentage or favorable element.
|
||||
export function getDayMasterIcon(report: Pick<FiveElementReport, 'masterElement'> | null | undefined) {
|
||||
const element = report?.masterElement
|
||||
return element && Object.prototype.hasOwnProperty.call(elementIcons, element)
|
||||
? elementIcons[element]
|
||||
: { kind: 'unknown', label: '?', color: '#9a91b1' }
|
||||
}
|
||||
Reference in new issue
Block a user