Spaces:
Sleeping
Sleeping
| """Action Items utility functions โ status/priority/category styling.""" | |
| STATUS_CONFIG = { | |
| "pending": {"emoji": "๐ด", "label": "๋๊ธฐ", "color": "#ff6b6b", "bg": "#FEE2E2"}, | |
| "in_progress": {"emoji": "๐ก", "label": "์งํ", "color": "#f59e0b", "bg": "#FEF3C7"}, | |
| "completed": {"emoji": "๐ข", "label": "์๋ฃ", "color": "#10b981", "bg": "#D1FAE5"}, | |
| "archived": {"emoji": "โช", "label": "๋ณด๊ด", "color": "#9ca3af", "bg": "#F3F4F6"}, | |
| } | |
| STATUS_OPTIONS = ["pending", "in_progress", "completed", "archived"] | |
| STATUS_LABELS = {k: f"{v['emoji']} {v['label']}" for k, v in STATUS_CONFIG.items()} | |
| CATEGORY_CONFIG = { | |
| "ํ๋ซํผ์ต์ ํ": {"color": "#4361ee", "icon": "๐"}, | |
| "์ฑ๋์ ๋ต": {"color": "#3a0ca3", "icon": "๐ก"}, | |
| "SEO๊ฐํ": {"color": "#7209b7", "icon": "๐"}, | |
| "๊ฐ์ฑ๊ด๋ฆฌ": {"color": "#f72585", "icon": "๐ฌ"}, | |
| "์ฝํ ์ธ ๊ฐ์ ": {"color": "#4cc9f0", "icon": "๐"}, | |
| "๋ถ์ ๊ฐ์ฑ๋์": {"color": "#e63946", "icon": "๐ก๏ธ"}, | |
| } | |
| # Legacy alias | |
| CATEGORY_COLORS = {k: v["color"] for k, v in CATEGORY_CONFIG.items()} | |
| def priority_level(priority: int) -> tuple[str, str, str]: | |
| """Return (label, color, bg) based on priority score.""" | |
| if priority >= 80: | |
| return "๊ธด๊ธ", "#dc2626", "#FEE2E2" | |
| if priority >= 60: | |
| return "๋์", "#f59e0b", "#FEF3C7" | |
| if priority >= 40: | |
| return "๋ณดํต", "#3b82f6", "#DBEAFE" | |
| return "๋ฎ์", "#9ca3af", "#F3F4F6" | |
| def status_emoji(status: str) -> str: | |
| """Return emoji for status.""" | |
| return STATUS_CONFIG.get(status, {}).get("emoji", "โ") | |
| def status_label(status: str) -> str: | |
| """Return localized label for status.""" | |
| return STATUS_CONFIG.get(status, {}).get("label", status) | |