mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
52617baf0e
* dv: seperating constants for ce and ee * dev: update estimate constants * dev: updated estimate structure for ce and ee
43 lines
1.4 KiB
TypeScript
43 lines
1.4 KiB
TypeScript
import { FC } from "react";
|
|
import { observer } from "mobx-react";
|
|
import { Crown, Pen, Trash } from "lucide-react";
|
|
import { Tooltip } from "@plane/ui";
|
|
|
|
type TEstimateListItem = {
|
|
estimateId: string;
|
|
isAdmin: boolean;
|
|
isEstimateEnabled: boolean;
|
|
isEditable: boolean;
|
|
onEditClick?: (estimateId: string) => void;
|
|
onDeleteClick?: (estimateId: string) => void;
|
|
};
|
|
|
|
export const EstimateListItemButtons: FC<TEstimateListItem> = observer((props) => {
|
|
const { estimateId, isAdmin, isEditable, onDeleteClick } = props;
|
|
|
|
if (!isAdmin || !isEditable) return <></>;
|
|
return (
|
|
<div className="relative flex items-center gap-1">
|
|
<Tooltip
|
|
tooltipContent={
|
|
<div className="relative flex items-center gap-2">
|
|
<div>Upgrade</div>
|
|
<Crown size={12} className="text-amber-400" />
|
|
</div>
|
|
}
|
|
position="top"
|
|
>
|
|
<button className="relative flex-shrink-0 w-6 h-6 flex justify-center items-center rounded cursor-pointer transition-colors overflow-hidden hover:bg-custom-background-80">
|
|
<Pen size={12} />
|
|
</button>
|
|
</Tooltip>
|
|
<button
|
|
className="relative flex-shrink-0 w-6 h-6 flex justify-center items-center rounded cursor-pointer transition-colors overflow-hidden hover:bg-custom-background-80"
|
|
onClick={() => onDeleteClick && onDeleteClick(estimateId)}
|
|
>
|
|
<Trash size={12} />
|
|
</button>
|
|
</div>
|
|
);
|
|
});
|