bb-plane-fork/apps/web/ce/components/workflow/state-option.tsx
Anmol Singh Bhatia 2980c2d76b
refactor: actions icon migration (#8219)
* chore: gitignore updated

* chore: check icon added to propel package

* feat: search icon migration

* chore: check icon migration

* chore: plus icon added to propel package

* chore: code refactor

* chore: plus icon migration and code refactor

* chore: trash icon added to propel package

* chore: code refactor

* chore: trash icon migration

* chore: edit icon added to propel package

* chore: new tab icon added to propel package

* chore: edit icon migration

* chore: newtab icon migration

* chore: lock icon added to propel package

* chore: lock icon migration

* chore: globe icon added to propel package

* chore: globe icon migration

* chore: copy icon added to propel package

* chore: copy icon migration

* chore: link icon added to propel package

* chore: link icon migration

* chore: link icon migration

* chore: info icon added to propel package

* chore: code refactor

* chore: code refactor

* chore: code refactor

* chore: code refactor
2025-12-26 17:19:15 +05:30

39 lines
1.1 KiB
TypeScript

import { observer } from "mobx-react";
import { Combobox } from "@headlessui/react";
import { CheckIcon } from "@plane/propel/icons";
import { cn } from "@plane/utils";
export type TStateOptionProps = {
projectId: string | null | undefined;
option: {
value: string | undefined;
query: string;
content: React.ReactNode;
};
selectedValue: string | null | undefined;
className?: string;
filterAvailableStateIds?: boolean;
isForWorkItemCreation?: boolean;
alwaysAllowStateChange?: boolean;
};
export const StateOption = observer(function StateOption(props: TStateOptionProps) {
const { option, className = "" } = props;
return (
<Combobox.Option
key={option.value}
value={option.value}
className={({ active, selected }) =>
cn(`${className} ${active ? "bg-layer-transparent-hover" : ""} ${selected ? "text-primary" : "text-secondary"}`)
}
>
{({ selected }) => (
<>
<span className="flex-grow truncate">{option.content}</span>
{selected && <CheckIcon className="h-3.5 w-3.5 flex-shrink-0" />}
</>
)}
</Combobox.Option>
);
});