import { components, OptionProps } from "react-select"; import { faCheckCircle } from "@fortawesome/free-regular-svg-icons"; import { faPlus } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import { Badge } from "@app/components/v2"; import { PAM_RESOURCE_TYPE_MAP, PamResourceType } from "@app/hooks/api/pam"; export const PamResourceOption = ({ isSelected, children, ...props }: OptionProps<{ id: string; name: string; resourceType: PamResourceType }>) => { const isCreateOption = props.data.id === "_create"; const { name, image } = PAM_RESOURCE_TYPE_MAP[props.data.resourceType]; return (
{isCreateOption ? (
Create New Resource
) : ( <>

{children}

{`${name} {name}
{isSelected && ( )} )}
); };