import React from "react";
// We inline font-awesome icons in order to save on js size rather than including the font awesome react library
export const SHAPES = [
{
icon: (
// fa-mouse-pointer
),
value: "selection",
},
{
icon: (
// fa-square
),
value: "rectangle",
},
{
icon: (
// custom
),
value: "diamond",
},
{
icon: (
// fa-circle
),
value: "ellipse",
},
{
icon: (
// fa-long-arrow-alt-right
),
value: "arrow",
},
{
icon: (
// custom
),
value: "line",
},
{
icon: (
// fa-font
),
value: "text",
},
] as const;
export const shapesShortcutKeys = SHAPES.map((shape, index) => [
shape.value[0],
(index + 1).toString(),
]).flat(1);
export function findShapeByKey(key: string) {
return (
SHAPES.find((shape, index) => {
return shape.value[0] === key || key === (index + 1).toString();
})?.value || "selection"
);
}