Skip to content

Commit 9dae748

Browse files
committed
download button below table in section 5 and remove on other places
1 parent 355c233 commit 9dae748

File tree

2 files changed

+17
-20
lines changed

2 files changed

+17
-20
lines changed

src/assets/synthetic-data.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,9 @@ def run():
354354
'data': synthetic_data.head().to_json(orient="records")
355355
}))
356356
357+
setResult(json.dumps({
358+
'type': 'export-button',
359+
}))
357360
358361
setResult(json.dumps({
359362
'type': 'heading',

src/routes/SyntheticData.tsx

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -161,18 +161,22 @@ export default function SyntheticDataGeneration() {
161161
loading && 'overflow-hidden'
162162
)}
163163
>
164-
{initialised && data.data.length > 0 && result.length > 0 && (
165-
<ExportButton
166-
buttonAlign="right"
167-
clusterInfo={clusterInfo}
164+
{result.length > 0 ? (
165+
<ComponentMapper
166+
items={result}
168167
data={data}
169-
handleExport={handleExport}
170-
reactToPrintFn={reactToPrintFn}
168+
exportButton={
169+
<div className="flex flex-row gap-2 hideonprint justify-start">
170+
<ExportButton
171+
buttonAlign={'left'}
172+
clusterInfo={clusterInfo}
173+
reactToPrintFn={reactToPrintFn}
174+
data={data}
175+
handleExport={handleExport}
176+
/>
177+
</div>
178+
}
171179
/>
172-
)}
173-
174-
{result.length > 0 ? (
175-
<ComponentMapper items={result} data={data} />
176180
) : loading ? (
177181
<LoadingState
178182
loadingMessageKey={loadingMessage}
@@ -189,16 +193,6 @@ export default function SyntheticDataGeneration() {
189193
<div className="flex-1" />
190194
</>
191195
)}
192-
193-
{initialised && data.data.length > 0 && result.length > 0 && (
194-
<ExportButton
195-
buttonAlign="center"
196-
clusterInfo={clusterInfo}
197-
data={data}
198-
handleExport={handleExport}
199-
reactToPrintFn={reactToPrintFn}
200-
/>
201-
)}
202196
</div>
203197
</main>
204198
);

0 commit comments

Comments
 (0)