|
1 | 1 | import type { Workspace } from "@yaakapp-internal/models"; |
2 | 2 | import { workspacesAtom } from "@yaakapp-internal/models"; |
3 | | -import { HStack, VStack } from "@yaakapp-internal/ui"; |
| 3 | +import { VStack } from "@yaakapp-internal/ui"; |
4 | 4 | import { useAtomValue } from "jotai"; |
5 | 5 | import { useCallback, useMemo, useState } from "react"; |
6 | 6 | import slugify from "slugify"; |
7 | 7 | import { activeWorkspaceAtom } from "../hooks/useActiveWorkspace"; |
8 | 8 | import { pluralizeCount } from "../lib/pluralize"; |
9 | 9 | import { rpc } from "../lib/rpc"; |
10 | 10 | import { CommercialUseBanner } from "./CommercialUseBanner"; |
11 | | -import { Button } from "./core/Button"; |
12 | 11 | import { Checkbox } from "./core/Checkbox"; |
13 | 12 | import { DetailsBanner } from "./core/DetailsBanner"; |
| 13 | +import { DialogFooter } from "./core/Dialog"; |
14 | 14 | import { Link } from "./core/Link"; |
15 | 15 | import { platform } from "@yaakapp-internal/platform"; |
16 | 16 |
|
@@ -87,8 +87,8 @@ function ExportDataDialogContent({ |
87 | 87 | const numSelected = Object.values(selectedWorkspaces).filter(Boolean).length; |
88 | 88 | const noneSelected = numSelected === 0; |
89 | 89 | return ( |
90 | | - <div className="h-full w-full grid grid-rows-[minmax(0,1fr)_auto] overflow-hidden rounded-b-lg"> |
91 | | - <VStack space={3} className="overflow-auto px-5 pb-6"> |
| 90 | + <> |
| 91 | + <VStack space={3} className="pb-4"> |
92 | 92 | <CommercialUseBanner source="data-export" title="Exporting work data?" /> |
93 | 93 |
|
94 | 94 | <table className="w-full mb-auto min-w-full max-w-full divide-y divide-surface-highlight"> |
@@ -141,29 +141,22 @@ function ExportDataDialogContent({ |
141 | 141 | /> |
142 | 142 | </DetailsBanner> |
143 | 143 | </VStack> |
144 | | - <footer className="px-5 grid grid-cols-[1fr_auto] items-center bg-surface py-3 border-t border-border-subtle"> |
145 | | - <div> |
| 144 | + <DialogFooter |
| 145 | + leftSlot={ |
146 | 146 | <Link href="https://yaak.app/button/new" noUnderline className="text-text-subtlest"> |
147 | 147 | Create Run Button |
148 | 148 | </Link> |
149 | | - </div> |
150 | | - <HStack space={2} justifyContent="end"> |
151 | | - <Button size="sm" className="focus" variant="border" onClick={onHide}> |
152 | | - Cancel |
153 | | - </Button> |
154 | | - <Button |
155 | | - size="sm" |
156 | | - type="submit" |
157 | | - className="focus" |
158 | | - color="primary" |
159 | | - disabled={noneSelected} |
160 | | - onClick={() => handleExport()} |
161 | | - > |
162 | | - Export{" "} |
163 | | - {pluralizeCount("Workspace", numSelected, { omitSingle: true, noneWord: "Nothing" })} |
164 | | - </Button> |
165 | | - </HStack> |
166 | | - </footer> |
167 | | - </div> |
| 149 | + } |
| 150 | + actions={[ |
| 151 | + { label: "Cancel", onClick: onHide }, |
| 152 | + { |
| 153 | + label: `Export ${pluralizeCount("Workspace", numSelected, { omitSingle: true, noneWord: "Nothing" })}`, |
| 154 | + color: "primary", |
| 155 | + disabled: noneSelected, |
| 156 | + onClick: () => handleExport(), |
| 157 | + }, |
| 158 | + ]} |
| 159 | + /> |
| 160 | + </> |
168 | 161 | ); |
169 | 162 | } |
0 commit comments