plane/apps/app/components/issues/select/priority.tsx
Aaryan Khandelwal 2ec8fbab34
style: modals theming (#940)
* style: existing issues list modal

* style: parent issues list modal

* style: issue modal

* style: cycle modal

* style: module modal

* style: view modal

* style: page modal

* style: delete modals
2023-04-24 11:19:53 +05:30

43 lines
1.2 KiB
TypeScript

import React from "react";
// ui
import { CustomSelect } from "components/ui";
// icons
import { getPriorityIcon } from "components/icons/priority-icon";
// constants
import { PRIORITIES } from "constants/project";
type Props = {
value: string | null;
onChange: (value: string) => void;
};
export const IssuePrioritySelect: React.FC<Props> = ({ value, onChange }) => (
<CustomSelect
value={value}
label={
<div className="flex items-center justify-center gap-2 text-xs">
<span className="flex items-center">
{getPriorityIcon(value, `text-xs ${value ? "" : "text-brand-secondary"}`)}
</span>
<span className={`${value ? "" : "text-brand-secondary"} capitalize`}>
{value ?? "Priority"}
</span>
</div>
}
onChange={onChange}
noChevron
>
{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">
<span>{getPriorityIcon(priority)}</span>
<span className="capitalize">{priority ?? "None"}</span>
</div>
</div>
</CustomSelect.Option>
))}
</CustomSelect>
);