2023-09-11 06:15:28 +00:00
|
|
|
// icons
|
2024-03-19 14:38:35 +00:00
|
|
|
import { TStateGroups } from "@plane/types";
|
2023-09-11 06:15:28 +00:00
|
|
|
import {
|
|
|
|
StateGroupBacklogIcon,
|
|
|
|
StateGroupCancelledIcon,
|
|
|
|
StateGroupCompletedIcon,
|
|
|
|
StateGroupStartedIcon,
|
|
|
|
StateGroupUnstartedIcon,
|
2024-03-19 14:38:35 +00:00
|
|
|
} from "@/components/icons";
|
2023-09-11 06:15:28 +00:00
|
|
|
// types
|
2024-03-19 14:38:35 +00:00
|
|
|
import { STATE_GROUPS } from "@/constants/state";
|
2023-09-11 06:15:28 +00:00
|
|
|
// constants
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
className?: string;
|
|
|
|
color?: string;
|
|
|
|
height?: string;
|
|
|
|
stateGroup: TStateGroups;
|
|
|
|
width?: string;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const StateGroupIcon: React.FC<Props> = ({
|
|
|
|
className = "",
|
|
|
|
color,
|
|
|
|
height = "12px",
|
|
|
|
width = "12px",
|
|
|
|
stateGroup,
|
|
|
|
}) => {
|
|
|
|
if (stateGroup === "backlog")
|
|
|
|
return (
|
|
|
|
<StateGroupBacklogIcon
|
|
|
|
width={width}
|
|
|
|
height={height}
|
2024-01-18 10:19:54 +00:00
|
|
|
color={color ?? STATE_GROUPS["backlog"].color}
|
2023-09-11 06:15:28 +00:00
|
|
|
className={`flex-shrink-0 ${className}`}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
else if (stateGroup === "cancelled")
|
|
|
|
return (
|
|
|
|
<StateGroupCancelledIcon
|
|
|
|
width={width}
|
|
|
|
height={height}
|
2024-01-18 10:19:54 +00:00
|
|
|
color={color ?? STATE_GROUPS["cancelled"].color}
|
2023-09-11 06:15:28 +00:00
|
|
|
className={`flex-shrink-0 ${className}`}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
else if (stateGroup === "completed")
|
|
|
|
return (
|
|
|
|
<StateGroupCompletedIcon
|
|
|
|
width={width}
|
|
|
|
height={height}
|
2024-01-18 10:19:54 +00:00
|
|
|
color={color ?? STATE_GROUPS["completed"].color}
|
2023-09-11 06:15:28 +00:00
|
|
|
className={`flex-shrink-0 ${className}`}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
else if (stateGroup === "started")
|
|
|
|
return (
|
|
|
|
<StateGroupStartedIcon
|
|
|
|
width={width}
|
|
|
|
height={height}
|
2024-01-18 10:19:54 +00:00
|
|
|
color={color ?? STATE_GROUPS["started"].color}
|
2023-09-11 06:15:28 +00:00
|
|
|
className={`flex-shrink-0 ${className}`}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
else
|
|
|
|
return (
|
|
|
|
<StateGroupUnstartedIcon
|
|
|
|
width={width}
|
|
|
|
height={height}
|
2024-01-18 10:19:54 +00:00
|
|
|
color={color ?? STATE_GROUPS["unstarted"].color}
|
2023-09-11 06:15:28 +00:00
|
|
|
className={`flex-shrink-0 ${className}`}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|