diff --git a/src/components/dialog/dialog.tsx b/src/components/dialog/dialog.tsx index 2a38d96b3..ad513c936 100644 --- a/src/components/dialog/dialog.tsx +++ b/src/components/dialog/dialog.tsx @@ -3,6 +3,7 @@ import * as DialogPrimitive from '@radix-ui/react-dialog'; import { Cross2Icon } from '@radix-ui/react-icons'; import { cn } from '@/lib/utils'; +import { ScrollArea } from '../scroll-area/scroll-area'; const Dialog = DialogPrimitive.Root; @@ -110,6 +111,18 @@ const DialogDescription = React.forwardRef< )); DialogDescription.displayName = DialogPrimitive.Description.displayName; +const DialogInternalContent = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)); +DialogInternalContent.displayName = 'DialogInternalContent'; + export { Dialog, DialogPortal, @@ -121,4 +134,5 @@ export { DialogFooter, DialogTitle, DialogDescription, + DialogInternalContent, }; diff --git a/src/components/scroll-area/scroll-area.tsx b/src/components/scroll-area/scroll-area.tsx index 267001dda..afc353709 100644 --- a/src/components/scroll-area/scroll-area.tsx +++ b/src/components/scroll-area/scroll-area.tsx @@ -12,7 +12,7 @@ const ScrollArea = React.forwardRef< className={cn('relative overflow-hidden', className)} {...props} > - + {children} @@ -40,7 +40,7 @@ const ScrollBar = React.forwardRef< )} {...props} > - + )); ScrollBar.displayName = ScrollAreaPrimitive.ScrollAreaScrollbar.displayName; diff --git a/src/dialogs/common/import-database/import-database.tsx b/src/dialogs/common/import-database/import-database.tsx index 0d92d998a..9dc06f874 100644 --- a/src/dialogs/common/import-database/import-database.tsx +++ b/src/dialogs/common/import-database/import-database.tsx @@ -5,6 +5,7 @@ import { DialogDescription, DialogFooter, DialogHeader, + DialogInternalContent, DialogTitle, } from '@/components/dialog/dialog'; import { ToggleGroup, ToggleGroupItem } from '@/components/toggle/toggle-group'; @@ -157,188 +158,201 @@ export const ImportDatabase: React.FC = ({ const renderContent = useCallback(() => { return ( -
- {databaseTypeToEditionMap[databaseType].length > 0 ? ( -
-

- {t( - 'new_diagram_dialog.import_database.database_edition' - )} -

- { - setDatabaseEdition( - value === 'regular' - ? undefined - : (value as DatabaseEdition) - ); - }} - > - +
+ {databaseTypeToEditionMap[databaseType].length > 0 ? ( +
+

+ {t( + 'new_diagram_dialog.import_database.database_edition' + )} +

+ { + setDatabaseEdition( + value === 'regular' + ? undefined + : (value as DatabaseEdition) + ); + }} > - - - Regular - - Regular - - {databaseTypeToEditionMap[databaseType].map( - (edition) => ( - - - - - { - databaseEditionToLabelMap[ - edition - ] - } - - - {databaseEditionToLabelMap[edition]} - - ) + + + + Regular + + Regular + + {databaseTypeToEditionMap[databaseType].map( + (edition) => ( + + + + + { + databaseEditionToLabelMap[ + edition + ] + } + + + {databaseEditionToLabelMap[edition]} + + ) + )} + +
+ ) : null} +
+
+
+ 1.{' '} + {t('new_diagram_dialog.import_database.step_1')} +
+ {databaseType === DatabaseType.SQL_SERVER && ( + )} - -
- ) : null} -
-
-
- 1. {t('new_diagram_dialog.import_database.step_1')}
- {databaseType === DatabaseType.SQL_SERVER && ( - - )} -
- {databaseTypeToClientsMap[databaseType].length > 0 ? ( - { - setDatabaseClient( - value === 'dbclient' - ? undefined - : (value as DatabaseClient) - ); - }} - > -
- - - DB Client - - - {databaseClients?.map((client) => ( + {databaseTypeToClientsMap[databaseType].length > 0 ? ( + { + setDatabaseClient( + value === 'dbclient' + ? undefined + : (value as DatabaseClient) + ); + }} + > +
+ - {databaseClientToLabelMap[client]} + DB Client - )) ?? []} - -
+ + {databaseClients?.map((client) => ( + + { + databaseClientToLabelMap[ + client + ] + } + + )) ?? []} +
+
+ +
+ ) : ( - - ) : ( - - )} -
-
-

- 2. {t('new_diagram_dialog.import_database.step_2')} -

-