// mobx import { useMobxStore } from "lib/mobx/store-provider"; import { observer } from "mobx-react-lite"; // components import { CustomCheckboxAttribute } from "components/custom-attributes"; // ui import { Loader, Tooltip } from "components/ui"; type Props = { entityId: string; issueId: string; onChange: (attributeId: string, val: string | string[] | undefined) => void; projectId: string; values: { [key: string]: string[] }; }; export const CustomAttributesCheckboxes: React.FC = observer((props) => { const { entityId, issueId, onChange, projectId, values } = props; const { customAttributes } = useMobxStore(); const attributes = customAttributes.entityAttributes[entityId] ?? {}; const checkboxFields = Object.values(attributes).filter((a) => a.type === "checkbox"); return ( <> {customAttributes.fetchEntityDetailsLoader ? ( ) : (
{Object.entries(checkboxFields).map(([attributeId, attribute]) => (

{attribute.display_name}

onChange(attribute.id, [`${val}`])} projectId={projectId} value={values[attribute.id]?.[0] === "true" ? true : false} />
))}
)} ); });