plane/web/components/issues/select/project.tsx
Anmol Singh Bhatia 651b252c23
chore: icon revamp and refactor (#2447)
* chore: svg icons added in plane/ui package

* chore: swap priority and state icon with plane/ui icons

* chore: replace core folder icons with lucide and plane ui icons

* style: priority icon size

* chore: replace icons with lucide and plane/ui icons

* chore: replace cycle folder icons with lucide and plane/ui icons

* chore: replace existing icons with lucide and plane/ui icons

* chore: replace existing icons with lucide and plane/ui icons

* chore: replace existing icons with lucide and plane/ui icons

* chore: replace existing icons with lucide and plane/ui icons

* chore: replace existing icons with lucide and plane/ui icons

* fix: build error

* fix: build error

* fix: build error
2023-10-16 20:27:22 +05:30

44 lines
1.1 KiB
TypeScript

// hooks
import useProjects from "hooks/use-projects";
// ui
import { CustomSelect } from "components/ui";
// icons
import { Clipboard } from "lucide-react";
export interface IssueProjectSelectProps {
value: string;
onChange: (value: string) => void;
}
export const IssueProjectSelect: React.FC<IssueProjectSelectProps> = ({ value, onChange }) => {
const { projects } = useProjects();
return (
<CustomSelect
value={value}
label={
<>
<Clipboard className="h-3 w-3" />
<span className="block truncate">{projects?.find((i) => i.id === value)?.identifier ?? "Project"}</span>
</>
}
onChange={(val: string) => onChange(val)}
noChevron
>
{projects ? (
projects.length > 0 ? (
projects.map((project) => (
<CustomSelect.Option key={project.id} value={project.id}>
<>{project.name}</>
</CustomSelect.Option>
))
) : (
<p className="text-gray-400">No projects found!</p>
)
) : (
<div className="px-2 text-sm text-custom-text-200">Loading...</div>
)}
</CustomSelect>
);
};