nx/graph/ui-project-details/src/lib/target-configuration-details-group-header/target-configuration-details-group-header.tsx
Emily Xiong 66ff751f0d
feat(graph): add expandedTargets to project details on nx dev (#26911)
<!-- Please make sure you have read the submission guidelines before
posting an PR -->
<!--
https://github.com/nrwl/nx/blob/master/CONTRIBUTING.md#-submitting-a-pr
-->

<!-- Please make sure that your commit message follows our format -->
<!-- Example: `fix(nx): must begin with lowercase` -->

<!-- If this is a particularly complex change or feature addition, you
can request a dedicated Nx release for this pull request branch. Mention
someone from the Nx team or the `@nrwl/nx-pipelines-reviewers` and they
will confirm if the PR warrants its own release for testing purposes,
and generate it for you if appropriate. -->

## Current Behavior
<!-- This is the behavior we have today -->

https://nx.dev/getting-started/tutorials/gradle-tutorial#running-tasks

## Expected Behavior
<!-- This is the behavior we should expect with the changes in this PR
-->


https://nx-dev-git-feat-graph-add-expand-targets-nrwl.vercel.app/getting-started/tutorials/gradle-tutorial#running-tasks

## Related Issue(s)
<!-- Please link the issue being fixed so it gets closed when this is
merged. -->

Fixes #

---------

Co-authored-by: Max Kless <maxk@nrwl.io>
2024-08-20 13:46:43 -04:00

35 lines
861 B
TypeScript

import { Pill } from '../pill';
import { Square3Stack3DIcon } from '@heroicons/react/24/outline';
export interface TargetConfigurationGroupHeaderProps {
targetGroupName: string;
targetsNumber: number;
className?: string;
showIcon?: boolean;
}
export const TargetConfigurationGroupHeader = ({
targetGroupName,
targetsNumber,
className = '',
}: TargetConfigurationGroupHeaderProps) => {
return (
<header
id={`target-group-header-${targetGroupName}`}
className={`flex items-center gap-2 px-4 py-2 text-lg capitalize ${className}`}
>
{targetGroupName}{' '}
{targetGroupName !== 'Others' && (
<Square3Stack3DIcon className="h-5 w-5" />
)}
<Pill
text={
targetsNumber.toString() +
(targetsNumber === 1 ? ' target' : ' targets')
}
/>
</header>
);
};