// ui import { IUserProfileData, IUserStateDistribution } from "@plane/types"; import { ProfileEmptyState, PieGraph } from "@/components/ui"; // image import { STATE_GROUPS } from "@/constants/state"; import stateGraph from "@/public/empty-state/state_graph.svg"; // types // constants type Props = { stateDistribution: IUserStateDistribution[]; userProfile: IUserProfileData | undefined; }; export const ProfileStateDistribution: React.FC = ({ stateDistribution, userProfile }) => { if (!userProfile) return null; return (

Issues by state

{userProfile.state_distribution.length > 0 ? (
({ id: group.state_group, label: group.state_group, value: group.state_count, color: STATE_GROUPS[group.state_group]?.color ?? "rgb(var(--color-primary-100))", })) ?? [] } height="250px" innerRadius={0.6} cornerRadius={5} padAngle={2} enableArcLabels arcLabelsTextColor="#000000" enableArcLinkLabels={false} activeInnerRadiusOffset={5} colors={(datum) => datum?.data?.color} tooltip={(datum) => (
{datum.datum.label} issues:{" "} {datum.datum.value}
)} margin={{ top: 32, right: 0, bottom: 32, left: 0, }} />
{stateDistribution.map((group) => (
{STATE_GROUPS[group.state_group].label}
{group.state_count}
))}
) : ( )}
); };