multica/apps/web/features/issues/components/priority-icon.tsx
Naiyuan Qing a2d7501d57 refactor(web): restructure to feature-based architecture with zustand stores
- Remove tab system entirely (tab-store, tab-bar, tab-link)
- Split monolithic AuthContext into zustand auth + workspace stores
- Move issue components/config to features/issues/
- Move WebSocket provider to features/realtime/
- Move api.ts to shared/
- Migrate all consumers from useAuth() to direct store imports
- Simplify sidebar: replace hand-built dropdown with shadcn DropdownMenu,
  replace custom layout wrapper with SidebarInset
- Remove unused @multica/store and @multica/hooks dependencies
- Add @/ path alias and zustand dependency
- Update CLAUDE.md with feature-based architecture conventions

Net change: +293 / -2435 lines

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-24 16:08:36 +08:00

57 lines
1.4 KiB
TypeScript

import type { IssuePriority } from "@multica/types";
import { PRIORITY_CONFIG } from "@/features/issues/config";
export function PriorityIcon({
priority,
className = "",
}: {
priority: IssuePriority;
className?: string;
}) {
const cfg = PRIORITY_CONFIG[priority];
// "none" — simple horizontal dashes
if (cfg.bars === 0) {
return (
<svg
viewBox="0 0 16 16"
className={`h-3.5 w-3.5 text-muted-foreground shrink-0 ${className}`}
fill="none"
stroke="currentColor"
strokeWidth="1.5"
strokeLinecap="round"
>
<line x1="3" y1="8" x2="13" y2="8" />
</svg>
);
}
const isUrgent = priority === "urgent";
return (
<svg
viewBox="0 0 16 16"
className={`h-3.5 w-3.5 ${cfg.color} shrink-0 ${className}`}
fill="currentColor"
style={isUrgent ? { animation: "priority-pulse 2s ease-in-out infinite" } : undefined}
>
{[0, 1, 2, 3].map((i) => (
<rect
key={i}
x={1 + i * 4}
width="3"
rx="0.5"
style={{
y: 12 - (i + 1) * 3,
height: (i + 1) * 3,
opacity: i < cfg.bars ? 1 : 0.2,
transition: "y 0.2s ease, height 0.2s ease, opacity 0.2s ease",
}}
/>
))}
{isUrgent && (
<style>{`@keyframes priority-pulse{0%,100%{transform:scale(1)}50%{transform:scale(1.08)}}`}</style>
)}
</svg>
);
}