Skip to content

Commit 7fa6f01

Browse files
committed
cp dines
1 parent ea17c8f commit 7fa6f01

2 files changed

Lines changed: 21 additions & 32 deletions

File tree

src/components/DevboxCreatePage.tsx

Lines changed: 19 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -483,18 +483,15 @@ export const DevboxCreatePage = ({
483483
}, []);
484484

485485
// Handle secret selection for gateway
486-
const handleSecretSelect = React.useCallback(
487-
(secrets: SecretListItem[]) => {
488-
if (secrets.length > 0) {
489-
const secret = secrets[0];
490-
setPendingSecret({ id: secret.id, name: secret.name || secret.id });
491-
}
492-
setShowSecretPicker(false);
493-
// Return to the form at the attach button
494-
setGatewayFormField("attach");
495-
},
496-
[],
497-
);
486+
const handleSecretSelect = React.useCallback((secrets: SecretListItem[]) => {
487+
if (secrets.length > 0) {
488+
const secret = secrets[0];
489+
setPendingSecret({ id: secret.id, name: secret.name || secret.id });
490+
}
491+
setShowSecretPicker(false);
492+
// Return to the form at the attach button
493+
setGatewayFormField("attach");
494+
}, []);
498495

499496
// Attach the configured gateway to the devbox
500497
const handleAttachGateway = React.useCallback(() => {
@@ -1183,7 +1180,10 @@ export const DevboxCreatePage = ({
11831180
const endpointWidth = Math.max(20, tw >= 140 ? 40 : 25);
11841181
const baseWidth = fixedWidth + idWidth + timeWidth;
11851182
const optionalWidth = showEndpoint ? endpointWidth : 0;
1186-
const nameWidth = Math.min(80, Math.max(15, tw - baseWidth - optionalWidth));
1183+
const nameWidth = Math.min(
1184+
80,
1185+
Math.max(15, tw - baseWidth - optionalWidth),
1186+
);
11871187
return [
11881188
createTextColumn<GatewayConfig>("id", "ID", (config) => config.id, {
11891189
width: idWidth + 1,
@@ -1784,9 +1784,7 @@ export const DevboxCreatePage = ({
17841784
const maxGatewayIndex = gatewayCount + 1;
17851785

17861786
const canAttach =
1787-
!!pendingGateway &&
1788-
!!pendingSecret &&
1789-
!!gatewayEnvPrefix.trim();
1787+
!!pendingGateway && !!pendingSecret && !!gatewayEnvPrefix.trim();
17901788

17911789
return (
17921790
<Box
@@ -1855,9 +1853,7 @@ export const DevboxCreatePage = ({
18551853
: colors.textDim
18561854
}
18571855
>
1858-
{gatewayFormField === "gateway"
1859-
? figures.pointer
1860-
: " "}{" "}
1856+
{gatewayFormField === "gateway" ? figures.pointer : " "}{" "}
18611857
AI Gateway:{" "}
18621858
</Text>
18631859
{pendingGateway ? (
@@ -1886,9 +1882,7 @@ export const DevboxCreatePage = ({
18861882
: colors.textDim
18871883
}
18881884
>
1889-
{gatewayFormField === "envName"
1890-
? figures.pointer
1891-
: " "}{" "}
1885+
{gatewayFormField === "envName" ? figures.pointer : " "}{" "}
18921886
ENV Name:{" "}
18931887
</Text>
18941888
{gatewayFormField === "envName" ? (
@@ -1900,9 +1894,7 @@ export const DevboxCreatePage = ({
19001894
) : (
19011895
<Text
19021896
color={
1903-
gatewayEnvPrefix
1904-
? colors.text
1905-
: colors.textDim
1897+
gatewayEnvPrefix ? colors.text : colors.textDim
19061898
}
19071899
dimColor={!gatewayEnvPrefix}
19081900
>
@@ -1920,15 +1912,11 @@ export const DevboxCreatePage = ({
19201912
: colors.textDim
19211913
}
19221914
>
1923-
{gatewayFormField === "secret"
1924-
? figures.pointer
1925-
: " "}{" "}
1915+
{gatewayFormField === "secret" ? figures.pointer : " "}{" "}
19261916
Secret:{" "}
19271917
</Text>
19281918
{pendingSecret ? (
1929-
<Text color={colors.success}>
1930-
{pendingSecret.name}
1931-
</Text>
1919+
<Text color={colors.success}>{pendingSecret.name}</Text>
19321920
) : (
19331921
<Text color={colors.textDim} dimColor>
19341922
(none selected)

src/components/SecretCreatePage.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ export const SecretCreatePage = ({
334334
return (
335335
<Box key={field.key} marginBottom={0}>
336336
<Text color={colors.textDim}>
337-
{" "}{field.label}:{" "}
337+
{" "}
338+
{field.label}:{" "}
338339
</Text>
339340
<Text color={colors.text} bold>
340341
{formData.name}

0 commit comments

Comments
 (0)