2023-01-26 18:12:20 +00:00
|
|
|
import React from "react";
|
|
|
|
|
2023-03-04 12:17:03 +00:00
|
|
|
// ui
|
2023-10-19 09:54:51 +00:00
|
|
|
import { CustomSelect, PriorityIcon } from "@plane/ui";
|
2023-09-11 09:05:58 +00:00
|
|
|
// types
|
|
|
|
import { TIssuePriorities } from "types";
|
2023-01-26 18:12:20 +00:00
|
|
|
// constants
|
2023-02-08 04:43:07 +00:00
|
|
|
import { PRIORITIES } from "constants/project";
|
2023-01-26 18:12:20 +00:00
|
|
|
|
|
|
|
type Props = {
|
2023-09-11 09:05:58 +00:00
|
|
|
value: TIssuePriorities;
|
2023-01-26 18:12:20 +00:00
|
|
|
onChange: (value: string) => void;
|
|
|
|
};
|
|
|
|
|
|
|
|
export const IssuePrioritySelect: React.FC<Props> = ({ value, onChange }) => (
|
2023-03-04 12:17:03 +00:00
|
|
|
<CustomSelect
|
|
|
|
value={value}
|
|
|
|
label={
|
|
|
|
<div className="flex items-center justify-center gap-2 text-xs">
|
|
|
|
<span className="flex items-center">
|
2023-10-16 14:57:22 +00:00
|
|
|
<PriorityIcon priority={value} className={`h-3.5 w-3.5 ${value ? "" : "text-custom-text-200"}`} />
|
2023-03-04 12:17:03 +00:00
|
|
|
</span>
|
2023-10-16 14:57:22 +00:00
|
|
|
<span className={`${value ? "" : "text-custom-text-200"} capitalize`}>{value ?? "Priority"}</span>
|
2023-03-04 12:17:03 +00:00
|
|
|
</div>
|
|
|
|
}
|
|
|
|
onChange={onChange}
|
2023-03-05 14:52:01 +00:00
|
|
|
noChevron
|
2023-03-04 12:17:03 +00:00
|
|
|
>
|
|
|
|
{PRIORITIES.map((priority) => (
|
|
|
|
<CustomSelect.Option key={priority} value={priority}>
|
|
|
|
<div className="flex w-full justify-between gap-2 rounded">
|
|
|
|
<div className="flex items-center justify-start gap-2">
|
2023-09-11 09:05:58 +00:00
|
|
|
<span>
|
|
|
|
<PriorityIcon priority={priority} />
|
|
|
|
</span>
|
2023-09-13 07:52:31 +00:00
|
|
|
<span className="capitalize">{priority}</span>
|
2023-03-04 12:17:03 +00:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</CustomSelect.Option>
|
|
|
|
))}
|
|
|
|
</CustomSelect>
|
2023-01-26 18:12:20 +00:00
|
|
|
);
|