summaryrefslogtreecommitdiff
path: root/makima/frontend/src/components/contracts/PhaseProgressBar.tsx
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-03-07 02:29:19 +0000
committerGitHub <noreply@github.com>2026-03-07 02:29:19 +0000
commitef643072234477685614ed281e34ef77e45caad4 (patch)
tree96562ad1b73efa0f21ea79ae571e1c8674549d31 /makima/frontend/src/components/contracts/PhaseProgressBar.tsx
parent0e30f1790cd3a1717dcb55ae137700de9bb0dfcb (diff)
parentae3bc57de7a240c3c8ab15080b405e8ea3e16ccb (diff)
downloadsoryu-ef643072234477685614ed281e34ef77e45caad4.tar.gz
soryu-ef643072234477685614ed281e34ef77e45caad4.zip
Merge pull request #86 from soryu-co/makima/directive-soryu-co-soryu---makima-19fd3e1d-v1772803139
feat: filter contract phase orbs by type & add DOGs (directive order groups)
Diffstat (limited to 'makima/frontend/src/components/contracts/PhaseProgressBar.tsx')
-rw-r--r--makima/frontend/src/components/contracts/PhaseProgressBar.tsx19
1 files changed, 13 insertions, 6 deletions
diff --git a/makima/frontend/src/components/contracts/PhaseProgressBar.tsx b/makima/frontend/src/components/contracts/PhaseProgressBar.tsx
index 5ee7999..9589db9 100644
--- a/makima/frontend/src/components/contracts/PhaseProgressBar.tsx
+++ b/makima/frontend/src/components/contracts/PhaseProgressBar.tsx
@@ -1,7 +1,9 @@
-import type { ContractPhase } from "../../lib/api";
+import type { ContractPhase, ContractType } from "../../lib/api";
+import { getValidPhases } from "../../lib/api";
interface PhaseProgressBarProps {
currentPhase: ContractPhase;
+ contractType?: ContractType;
onPhaseClick?: (phase: ContractPhase) => void;
readonly?: boolean;
}
@@ -46,14 +48,16 @@ const phaseColors: Record<ContractPhase, { active: string; inactive: string; com
export function PhaseProgressBar({
currentPhase,
+ contractType,
onPhaseClick,
readonly = false,
}: PhaseProgressBarProps) {
- const currentIndex = phases.indexOf(currentPhase);
+ const visiblePhases = contractType ? getValidPhases(contractType) : phases;
+ const currentIndex = visiblePhases.indexOf(currentPhase);
return (
<div className="flex items-center gap-1">
- {phases.map((phase, index) => {
+ {visiblePhases.map((phase, index) => {
const isActive = phase === currentPhase;
const isCompleted = index < currentIndex;
const colors = phaseColors[phase];
@@ -97,7 +101,7 @@ export function PhaseProgressBar({
</button>
{/* Connector line */}
- {index < phases.length - 1 && (
+ {index < visiblePhases.length - 1 && (
<div
className={`
w-8 h-0.5 mx-1
@@ -114,14 +118,17 @@ export function PhaseProgressBar({
export function PhaseProgressBarCompact({
currentPhase,
+ contractType,
}: {
currentPhase: ContractPhase;
+ contractType?: ContractType;
}) {
- const currentIndex = phases.indexOf(currentPhase);
+ const visiblePhases = contractType ? getValidPhases(contractType) : phases;
+ const currentIndex = visiblePhases.indexOf(currentPhase);
return (
<div className="flex items-center gap-0.5">
- {phases.map((phase, index) => {
+ {visiblePhases.map((phase, index) => {
const isActive = phase === currentPhase;
const isCompleted = index < currentIndex;
const colors = phaseColors[phase];