25 lines
605 B
TypeScript
25 lines
605 B
TypeScript
import type { Priority } from '../types/todo';
|
|
|
|
export const priorityLabels: { [key in Priority]: string } = {
|
|
low: '低',
|
|
medium: '中',
|
|
high: '高',
|
|
};
|
|
|
|
export const getPriorityTagColor = (priority: Priority): string => {
|
|
switch (priority) {
|
|
case 'low': return 'green';
|
|
case 'medium': return 'orange';
|
|
case 'high': return 'red';
|
|
default: return 'default';
|
|
}
|
|
};
|
|
|
|
export const getPriorityIcon = (priority: Priority): string => {
|
|
switch (priority) {
|
|
case 'low': return '🌱';
|
|
case 'medium': return '🌟';
|
|
case 'high': return '🔥';
|
|
default: return '';
|
|
}
|
|
};
|