Files
multica/packages/views/issues/components/priority-icon.tsx
Naiyuan Qing f41a0cf423 feat(views): extract packages/views — shared business UI + navigation adapter
- Create NavigationAdapter interface (push, replace, back, pathname, searchParams)
- Create AppLink component replacing next/link in 4 files
- Replace useRouter → useNavigation in 3 files (issue-detail, create-issue, create-workspace)
- Create WebNavigationProvider wrapping Next.js useRouter/usePathname/useSearchParams
- Move ~85 feature UI files (issues, editor, modals, my-issues, skills, runtimes) to packages/views/
- Add store singleton registration pattern (registerAuthStore, registerWorkspaceStore)
- Create data-aware wrappers in packages/views/common/ (ActorAvatar, Markdown)
- Update all app-layer imports to @multica/views/*
- Add @source directive for Tailwind to scan views package
- packages/views/ has zero next/* imports

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-09 11:49:55 +08:00

60 lines
1.5 KiB
TypeScript

import type { IssuePriority } from "@multica/core/types";
import { PRIORITY_CONFIG } from "@multica/core/issues/config";
export function PriorityIcon({
priority,
className = "",
inheritColor = false,
}: {
priority: IssuePriority;
className?: string;
inheritColor?: boolean;
}) {
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 ${inheritColor ? "" : "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 ${inheritColor ? "" : 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>
);
}