| @@ -23,9 +23,12 @@ | ||
| 23 | 23 | import { Card, CardContent } from "../components/ui/card"; |
| 24 | 24 | import { ConditionalRender } from "../components/ui/conditional-render"; |
| 25 | 25 | import { ConfirmationDialog } from "../components/ui/confirmation-dialog"; |
| 26 | 26 | import { Badge } from "../components/ui/badge"; |
| 27 | -import { IconSelector } from "../components/ui/icon-selector"; | |
| 27 | +import { | |
| 28 | + IconSelector, | |
| 29 | + type IconSelectorProvider, | |
| 30 | +} from "../components/ui/icon-selector"; | |
| 28 | 31 | |
| 29 | 32 | interface Attribute { |
| 30 | 33 | id: number; |
| 31 | 34 | name: string; |
| @@ -33,8 +36,9 @@ | ||
| 33 | 36 | description: string; |
| 34 | 37 | icon: { |
| 35 | 38 | type: "icon" | "image"; |
| 36 | 39 | value: string; |
| 40 | + provider?: IconSelectorProvider; | |
| 37 | 41 | } | null; |
| 38 | 42 | field_type: string; |
| 39 | 43 | field_options: any; |
| 40 | 44 | default_value: string; |
| @@ -173,8 +177,9 @@ | ||
| 173 | 177 | }, |
| 174 | 178 | enabled: can("yatra_view_trips"), |
| 175 | 179 | }); |
| 176 | 180 | |
| 181 | + // eslint-disable-next-line react-hooks/exhaustive-deps | |
| 177 | 182 | const attributes = attributesData?.data || []; |
| 178 | 183 | const total = attributesData?.total || 0; |
| 179 | 184 | const totalPages = Math.ceil(total / 10); |
| 180 | 185 | const errorContext = getErrorContext(error); |
| @@ -286,8 +291,9 @@ | ||
| 286 | 291 | /> |
| 287 | 292 | ) : ( |
| 288 | 293 | <IconSelector |
| 289 | 294 | iconName={attribute.icon.value} |
| 295 | + provider={attribute.icon.provider ?? "yatra"} | |
| 290 | 296 | size={16} |
| 291 | 297 | className="text-purple-600 dark:text-purple-400" |
| 292 | 298 | /> |
| 293 | 299 | ) |