diff --git a/src/apps/schema/src/appRevamp/components/Field/FieldIcon.tsx b/src/apps/schema/src/appRevamp/components/Field/FieldIcon.tsx index 1bec86bc0f..d82e201af4 100644 --- a/src/apps/schema/src/appRevamp/components/Field/FieldIcon.tsx +++ b/src/apps/schema/src/appRevamp/components/Field/FieldIcon.tsx @@ -123,17 +123,23 @@ const icons: Icons = { backgroundColor: "purple.50", borderColor: "purple.700", }, + generic: { + icon: AttachmentRounded, + backgroundColor: "grey.100", + borderColor: "grey.700", + }, }; interface Props { type: string; } export const FieldIcon = ({ type }: Props) => { - const icon = icons[type].icon; - const borderColor = icons[type].borderColor; - const bgcolor = icons[type].backgroundColor; - const transform = - type === "files" || type === "images" ? "rotate(-45deg)" : ""; + const icon = icons[type]?.icon || icons["generic"].icon; + const borderColor = icons[type]?.borderColor || icons["generic"].borderColor; + const bgcolor = + icons[type]?.backgroundColor || icons["generic"].backgroundColor; + // Since we're using the paper clip icon for generic types we also rotate the icon + const transform = type === "images" || !icons[type] ? "rotate(-45deg)" : ""; return (