diff --git a/apps/designer/app/designer/features/props-panel/props-panel.tsx b/apps/designer/app/designer/features/props-panel/props-panel.tsx index 2465d9b862..5168971340 100644 --- a/apps/designer/app/designer/features/props-panel/props-panel.tsx +++ b/apps/designer/app/designer/features/props-panel/props-panel.tsx @@ -7,8 +7,8 @@ import { import { Control } from "~/designer/features/props-panel/control"; import { CollapsibleSection, ComponentInfo } from "~/designer/shared/inspector"; import type { SelectedInstanceData } from "~/shared/canvas-components"; -import { Box, Button, Grid, TextField } from "~/shared/design-system"; -import { PlusIcon, TrashIcon } from "~/shared/icons"; +import { Box, Button, Grid, TextField, Tooltip } from "~/shared/design-system"; +import { PlusIcon, TrashIcon, ExclamationTriangleIcon } from "~/shared/icons"; import { handleChangePropType, usePropsLogic } from "./use-props-logic"; type PropertyProps = UserProp & { @@ -27,12 +27,22 @@ const Property = ({ onDelete, }: PropertyProps) => { const meta = componentsMeta[component]; - const argType = meta?.argTypes?.[prop as keyof typeof meta.argTypes]; - const type = argType?.control.type; + if (!meta) { + return "Unknown component"; + } + const argType = meta.argTypes?.[prop as keyof typeof meta.argTypes]; + const isInvalidProp = + prop.length > 0 && + typeof argType === "undefined" && + !prop.match(/^data-(.)+/); + const type = argType?.control.type || "text"; const defaultValue = argType?.control.defaultValue; const options = argType?.options; return ( - + - onChange(id, "value", value)} - /> + {!isInvalidProp ? ( + onChange(id, "value", value)} + /> + ) : ( + + + + )}