feat(onboarding): enhance integration setup with Docker discovery and URL templating (#5607)
This commit is contained in:
1 parent
0a6467979a
commit
dd7a4908a3
68 files changed
+2922
-434
No files matched your search
@@ -0,0 +1,50 @@
|
||||
"use client";
|
||||
|
||||
import type { KeyboardEvent, ReactNode } from "react";
|
||||
import { Input, ScrollArea, SimpleGrid, Stack } from "@mantine/core";
|
||||
import { IconSearch } from "@tabler/icons-react";
|
||||
|
||||
export const selectGridCols = { base: 2, xs: 3, sm: 4, md: 5 };
|
||||
export const selectGridCardHeight = 140;
|
||||
export const selectGridScrollMaxHeight = "70vh";
|
||||
|
||||
interface SelectGridLayoutProps {
|
||||
search: string;
|
||||
onSearchChange: (value: string) => void;
|
||||
placeholder: string;
|
||||
onSearchKeyDown?: (event: KeyboardEvent<HTMLInputElement>) => void;
|
||||
disableScroll?: boolean;
|
||||
disableAutoFocus?: boolean;
|
||||
children: ReactNode;
|
||||
}
|
||||
|
||||
export const SelectGridLayout = ({
|
||||
search,
|
||||
onSearchChange,
|
||||
placeholder,
|
||||
onSearchKeyDown,
|
||||
disableScroll = false,
|
||||
disableAutoFocus = false,
|
||||
children,
|
||||
}: SelectGridLayoutProps) => {
|
||||
const grid = (
|
||||
<SimpleGrid cols={selectGridCols} spacing="sm">
|
||||
{children}
|
||||
</SimpleGrid>
|
||||
);
|
||||
|
||||
return (
|
||||
<Stack>
|
||||
<Input
|
||||
value={search}
|
||||
onChange={(event) => onSearchChange(event.currentTarget.value)}
|
||||
leftSection={<IconSearch />}
|
||||
placeholder={placeholder}
|
||||
data-autofocus={disableAutoFocus ? undefined : true}
|
||||
onKeyDown={onSearchKeyDown}
|
||||
/>
|
||||
|
||||
{disableScroll ? grid : <ScrollArea.Autosize mah={selectGridScrollMaxHeight}>{grid}</ScrollArea.Autosize>}
|
||||
</Stack>
|
||||
);
|
||||
};
|
||||
Reference in new issue
Block a user