@microlight/core 0.9.9 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (30) hide show
  1. package/dist/server/app/layout.js +2 -18
  2. package/dist/server/app/library/[[...f_path]]/ViewFolder.js +37 -66
  3. package/dist/server/app/monitoring/MonitoringDashboard.js +329 -0
  4. package/dist/server/app/monitoring/action.js +147 -0
  5. package/dist/server/app/monitoring/page.js +8 -0
  6. package/dist/server/app/tasks/[slug]/ViewTask.js +81 -173
  7. package/dist/server/app/tasks/[slug]/runs/[r_id]/ViewRun.js +68 -164
  8. package/dist/server/app/tasks/[slug]/runs/[r_id]/_components/DropdownActions/DropdownActions.js +19 -25
  9. package/dist/server/components/Link.js +6 -15
  10. package/dist/server/components/MLInput.js +19 -22
  11. package/dist/server/components/Navbar/Navbar.js +25 -31
  12. package/dist/server/components/Navbar/NavbarContainer.js +7 -20
  13. package/dist/server/components/PageHeader.js +22 -54
  14. package/dist/server/components/StatusChip.js +5 -5
  15. package/dist/server/components/ui/alert.js +61 -0
  16. package/dist/server/components/ui/badge.js +37 -0
  17. package/dist/server/components/ui/breadcrumb.js +82 -0
  18. package/dist/server/components/ui/button.js +65 -0
  19. package/dist/server/components/ui/card.js +81 -0
  20. package/dist/server/components/ui/dropdown-menu.js +222 -0
  21. package/dist/server/components/ui/input.js +21 -0
  22. package/dist/server/components/ui/label.js +20 -0
  23. package/dist/server/components/ui/select.js +165 -0
  24. package/dist/server/components/ui/stack.js +104 -0
  25. package/dist/server/components/ui/table.js +77 -0
  26. package/dist/server/components/ui/tabs.js +59 -0
  27. package/dist/server/components/ui/typography.js +229 -0
  28. package/dist/server/utils/css/cn.js +11 -0
  29. package/package.json +15 -4
  30. package/dist/server/components/Icon.js +0 -22
@@ -1,7 +1,6 @@
1
1
  'use client';
2
2
 
3
- import OpenInNew from '@mui/icons-material/OpenInNew';
4
- import { Container, Typography, Box, Card, ButtonGroup, Button, Table, Chip, Link as MuiLink } from '@mui/joy';
3
+ import { ExternalLink } from 'lucide-react';
5
4
  import PageHeader from "../../../components/PageHeader";
6
5
  import MLInput from "../../../components/MLInput";
7
6
  import { useState } from 'react';
@@ -10,6 +9,10 @@ import { redirect } from 'next/navigation';
10
9
  import StatusChip from "../../../components/StatusChip";
11
10
  import cronstrue from 'cronstrue';
12
11
  import Link from "../../../components/Link";
12
+ import { Typography } from "../../../components/ui/typography";
13
+ import { Card } from "../../../components/ui/card";
14
+ import { Button } from "../../../components/ui/button";
15
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../../components/ui/table";
13
16
  function generateBreadcrumbs({
14
17
  task
15
18
  }) {
@@ -46,18 +49,14 @@ export default function ViewTask({
46
49
  });
47
50
  const [loading, setLoading] = useState(false);
48
51
  const RightButtons = function () {
49
- return <>
50
- {task?.links?.map((link, index) => {
51
- return <MuiLink key={index} underline="none" variant="outlined" color="neutral" target='_blank' href={link.href} startDecorator={<i className="fa-solid fa-up-right-from-square"></i>} sx={{
52
- mx: 0.5,
53
- px: 1,
54
- py: 0.5,
55
- borderRadius: 'md'
56
- }}>
57
- {link.title}
58
- </MuiLink>;
52
+ return <div className="flex gap-1">
53
+ {task?.links?.map((link, index) => {
54
+ return <a key={index} href={link.href} target="_blank" rel="noopener noreferrer" className="inline-flex items-center gap-1 px-2 py-1 text-sm border rounded-md hover:bg-accent transition-colors">
55
+ <ExternalLink className="h-3 w-3" />
56
+ {link.title}
57
+ </a>;
59
58
  })}
60
- </>;
59
+ </div>;
61
60
  };
62
61
  const handleSubmit = async event => {
63
62
  event.preventDefault();
@@ -70,175 +69,84 @@ export default function ViewTask({
70
69
  });
71
70
  if (result.success) redirect(`/tasks/${task.slug}/runs/${result.run.id}`);
72
71
  };
73
- return <Container>
72
+ return <div className="max-w-7xl mx-auto">
74
73
  <PageHeader breadcrumbs={breadcrumbs} header={{
75
74
  part1: 'Task:',
76
75
  part2: task.name
77
76
  }} RightButtons={RightButtons} />
78
77
  <Typography level="body-sm">{task.description}</Typography>
79
-
80
-
81
- <Card sx={{
82
- mt: 2,
83
- backgroundColor: 'transparent',
84
- maxWidth: 400
85
- }}>
78
+
79
+
80
+ <Card className="mt-4 bg-transparent max-w-[400px] p-4">
86
81
  <form onSubmit={handleSubmit}>
87
82
  {Object.keys(task.inputs).map(slug => <MLInput key={slug} slug={slug} def={task.inputs[slug]} searchParams={searchParams} />)}
88
- <ButtonGroup spacing={1}>
89
- {/* <Button type="submit" fullWidth color="primary" variant="solid" startDecorator={<FilterAltIcon />}>Apply filter</Button> */}
90
- <Button loading={loading} disabled={loading} type="submit" color='primary' variant="solid">Execute task</Button>
91
- {/* <Button loading={loading} disabled={loading} type="submit" color='primary' sx={{bgcolor:'#6435c9',borderRadius:3}} variant="solid">Execute task</Button> */}
92
- {/* <Button variant="outlined" onClick={handleReset}>Reset</Button> */}
93
- {/* <Button disabled={loading.apply} loading={loading.reset} fullWidth variant="outlined" color="primary" onClick={handleReset} >Reset</Button> */}
94
- </ButtonGroup>
83
+ <div className="flex gap-2">
84
+ <Button loading={loading} disabled={loading} type="submit">Execute task</Button>
85
+ </div>
95
86
  </form>
96
87
  </Card>
97
- <Typography level="title-lg" sx={{
98
- mt: 3
99
- }}>Schedules:</Typography>
88
+ <Typography level="title-lg" className="mt-6">Schedules:</Typography>
89
+
90
+ <div className="mt-2 max-w-[800px]">
91
+ <Table>
92
+ <TableHeader>
93
+ <TableRow>
94
+ <TableHead className="w-[100px]">Schedule</TableHead>
95
+ <TableHead className="w-[150px]">Description</TableHead>
96
+ <TableHead className="w-[300px]">Payload</TableHead>
97
+ <TableHead>Is Enabled?</TableHead>
98
+ </TableRow>
99
+ </TableHeader>
100
+ <TableBody>
101
+ {task?.schedules?.map((schedule, index) => <TableRow key={index}>
102
+ <TableCell>{schedule.schedule}</TableCell>
103
+ <TableCell>
104
+ {cronstrue.toString(schedule.schedule)}
105
+ </TableCell>
106
+ <TableCell className="overflow-auto scrollbar-hide">
107
+ <pre className="m-0">{schedule?.inputs ? JSON.stringify(schedule?.inputs, null, 2).slice(2, -2) : ""}</pre>
108
+ </TableCell>
109
+ <TableCell>
110
+ {schedule.is_enabled ? 'enabled' : 'disabled'}
111
+ </TableCell>
112
+ </TableRow>)}
113
+ </TableBody>
114
+ </Table>
115
+ </div>
100
116
 
101
- <Table variant='outlined' aria-label="task runs table" size='md' sx={{
102
- mt: 1,
103
- maxWidth: 800,
104
- '& th': {
105
- height: {
106
- sm: "22px",
107
- md: "26px",
108
- lg: "30px"
109
- }
110
- },
111
- '& td': {
112
- height: {
113
- sm: "23px",
114
- md: "27px",
115
- lg: "31px"
116
- }
117
- }
118
- }}>
119
- <thead>
120
- <tr>
121
- {/* <th ></th> */}
122
- <th style={{
123
- width: 100
124
- }}>Schedule</th>
125
- <th style={{
126
- width: 150
127
- }}>Description</th>
128
- <th style={{
129
- width: 300
130
- }}>Payload</th>
131
- <th>Is Enabled?</th>
132
- {/* <th>User</th> */}
133
- </tr>
134
- </thead>
135
- <tbody>
136
- {task?.schedules?.map((schedule, index) => <tr key={index}>
137
- <td>{schedule.schedule}</td>
138
- <td>
139
- {cronstrue.toString(schedule.schedule)}
140
- </td>
141
- <td style={{
142
- overflow: 'auto',
143
- '&::WebkitScrollbar': {
144
- display: 'none'
145
- },
146
- height: 0,
147
- scrollbarWidth: 'none',
148
- // Firefox
149
- msOverflowStyle: 'none' // IE and Edge
150
- }}>
151
- <pre style={{
152
- margin: 0
153
- }}>{schedule?.inputs ? JSON.stringify(schedule?.inputs, null, 2).slice(2, -2) : ""}</pre>
154
- </td>
155
- <td>
156
- {schedule.is_enabled ? 'enabled' : 'disabled'}
157
- </td>
117
+ <Typography level="title-lg" className="mt-6">Recent runs:</Typography>
158
118
 
159
- {/* <td>{run.user}</td> */}
160
- </tr>)}
161
- </tbody>
162
- </Table>
163
- <Typography level="title-lg" sx={{
164
- mt: 3
165
- }}>Recent runs:</Typography>
166
- {/* <pre>{JSON.stringify(runs,null,2)}</pre> */}
167
-
168
- <Table variant='outlined' aria-label="task runs table" size='md' sx={{
169
- mt: 1,
170
- maxWidth: 800,
171
- '& th': {
172
- height: {
173
- sm: "22px",
174
- md: "26px",
175
- lg: "30px"
176
- }
177
- },
178
- '& td': {
179
- height: {
180
- sm: "23px",
181
- md: "27px",
182
- lg: "31px"
183
- }
184
- }
185
- }}>
186
- <thead>
187
- <tr>
188
- {/* <th ></th> */}
189
- <th style={{
190
- width: 100
191
- }}>Created At</th>
192
- <th style={{
193
- width: 150
194
- }}>ID</th>
195
- <th style={{
196
- width: 300
197
- }}>Payload</th>
198
- <th>Status</th>
199
- <th style={{
200
- width: '58px'
201
- }}>Duration</th>
202
- <th>By</th>
203
- {/* <th>User</th> */}
204
- </tr>
205
- </thead>
206
- <tbody>
207
- {runs.map(run => <tr key={run.id}>
208
- <td>{new Date(run.updated_at).toLocaleString()}</td>
209
- <td>
210
- <Link href={`/tasks/${params.slug}/runs/${run.id}`} level="body-sm">
211
- {task.slug} #{run.id}
212
- </Link>
213
- </td>
214
- <td style={{
215
- overflow: 'auto',
216
- '&::WebkitScrollbar': {
217
- display: 'none'
218
- },
219
- height: 0,
220
- scrollbarWidth: 'none',
221
- // Firefox
222
- msOverflowStyle: 'none' // IE and Edge
223
- }}>
224
- <pre style={{
225
- margin: 0
226
- }}>{JSON.stringify(run?.inputs, null, 1).slice(2, -2)}</pre>
227
- </td>
228
- <td>
229
- <StatusChip status={run.status} />
230
- </td>
231
- <td style={{
232
- textAlign: 'right'
233
- }}>{run.duration / 1000 || 0}s</td>
234
- <td>{run.triggered_by || 'user'}</td>
235
- {/* <td>{run.user}</td> */}
236
- </tr>)}
237
- </tbody>
238
- </Table>
239
- {/* Add your task execution UI components here */}
240
-
241
- {/* Uncomment for debugging */}
242
- {/* <pre>{JSON.stringify(task, null, 2)}</pre> */}
243
- </Container>;
119
+ <div className="mt-2 max-w-[800px]">
120
+ <Table>
121
+ <TableHeader>
122
+ <TableRow>
123
+ <TableHead className="w-[100px]">Created At</TableHead>
124
+ <TableHead className="w-[150px]">ID</TableHead>
125
+ <TableHead className="w-[300px]">Payload</TableHead>
126
+ <TableHead>Status</TableHead>
127
+ <TableHead className="w-[58px]">Duration</TableHead>
128
+ <TableHead>By</TableHead>
129
+ </TableRow>
130
+ </TableHeader>
131
+ <TableBody>
132
+ {runs.map(run => <TableRow key={run.id}>
133
+ <TableCell>{new Date(run.updated_at).toLocaleString()}</TableCell>
134
+ <TableCell>
135
+ <Link href={`/tasks/${params.slug}/runs/${run.id}`}>
136
+ {task.slug} #{run.id}
137
+ </Link>
138
+ </TableCell>
139
+ <TableCell className="overflow-auto scrollbar-hide">
140
+ <pre className="m-0">{JSON.stringify(run?.inputs, null, 1).slice(2, -2)}</pre>
141
+ </TableCell>
142
+ <TableCell>
143
+ <StatusChip status={run.status} />
144
+ </TableCell>
145
+ <TableCell className="text-right">{run.duration / 1000 || 0}s</TableCell>
146
+ <TableCell>{run.triggered_by || 'user'}</TableCell>
147
+ </TableRow>)}
148
+ </TableBody>
149
+ </Table>
150
+ </div>
151
+ </div>;
244
152
  }
@@ -1,11 +1,13 @@
1
1
  'use client';
2
2
 
3
3
  import PageHeader from "../../../../../components/PageHeader";
4
- import { Container, Table, Link, Chip, Typography, Sheet, Alert } from "@mui/joy";
5
4
  import { useRouter } from 'next/navigation';
6
- import { useState, useEffect } from 'react';
5
+ import { useEffect } from 'react';
7
6
  import StatusChip from "../../../../../components/StatusChip";
8
7
  import DropdownActions from "./_components/DropdownActions/DropdownActions";
8
+ import { Typography } from "../../../../../components/ui/typography";
9
+ import { Alert, AlertDescription } from "../../../../../components/ui/alert";
10
+ import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "../../../../../components/ui/table";
9
11
  function generateBreadcrumbs({
10
12
  task,
11
13
  params
@@ -47,9 +49,7 @@ export default function ViewRun({
47
49
  });
48
50
  const router = useRouter();
49
51
  let RightButtons = function () {
50
- return <>
51
- <DropdownActions run={run} />
52
- </>;
52
+ return <DropdownActions run={run} />;
53
53
  };
54
54
  useEffect(() => {
55
55
  let intervalId;
@@ -65,172 +65,76 @@ export default function ViewRun({
65
65
  }
66
66
  };
67
67
  }, [run]);
68
- return <>
69
- <Container>
68
+ return <div className="max-w-7xl mx-auto">
70
69
  <PageHeader breadcrumbs={breadcrumbs} header={{
71
- part1: 'Task Run:',
72
- part2: task.name
73
- }} RightButtons={RightButtons}
74
- // icon={<SendIcon sx={{color: '#6435c9'}} />}
75
- />
76
- <Table variant='outlined' borderAxis="bothBetween" aria-label="task runs table" size='md' sx={{
77
- mt: 1,
78
- maxWidth: 500,
79
- '& th': {
80
- height: {
81
- sm: "22px",
82
- md: "26px",
83
- lg: "30px"
84
- }
85
- },
86
- '& td': {
87
- height: {
88
- sm: "23px",
89
- md: "27px",
90
- lg: "31px"
91
- }
92
- }
93
- }}>
94
- <thead>
95
- <tr>
96
- {/* <th ></th> */}
97
- <th>Created At</th>
98
- <th>Started At</th>
99
- {/* <th >ID</th> */}
100
- <th>Status</th>
101
- <th style={{
102
- width: '58px'
103
- }}>Duration</th>
104
- <th>By</th>
105
- {/* <th>User</th> */}
106
- </tr>
107
- </thead>
108
- <tbody>
109
- <tr key={run.id}>
110
- <td>{new Date(run.created_at).toLocaleString()}</td>
111
- <td>{run.started_at && new Date(run.started_at).toLocaleString()}</td>
112
-
113
- <td><StatusChip status={run.status} /></td>
114
- <td style={{
115
- textAlign: 'right'
116
- }}>{run.duration / 1000 || 0}s</td>
117
- <td>{run.by || 'user'}</td>
118
- {/* <td>{run.user}</td> */}
119
- </tr>
120
- </tbody>
121
- </Table>
122
- <Typography level="title-lg" sx={{
123
- mt: 3,
124
- mb: 1
125
- }}>Payload:</Typography>
70
+ part1: 'Task Run:',
71
+ part2: task.name
72
+ }} RightButtons={RightButtons} />
73
+ <div className="mt-2 max-w-[500px]">
74
+ <Table>
75
+ <TableHeader>
76
+ <TableRow>
77
+ <TableHead>Created At</TableHead>
78
+ <TableHead>Started At</TableHead>
79
+ <TableHead>Status</TableHead>
80
+ <TableHead className="w-[58px]">Duration</TableHead>
81
+ <TableHead>By</TableHead>
82
+ </TableRow>
83
+ </TableHeader>
84
+ <TableBody>
85
+ <TableRow>
86
+ <TableCell>{new Date(run.created_at).toLocaleString()}</TableCell>
87
+ <TableCell>{run.started_at && new Date(run.started_at).toLocaleString()}</TableCell>
88
+ <TableCell><StatusChip status={run.status} /></TableCell>
89
+ <TableCell className="text-right">{run.duration / 1000 || 0}s</TableCell>
90
+ <TableCell>{run.by || 'user'}</TableCell>
91
+ </TableRow>
92
+ </TableBody>
93
+ </Table>
94
+ </div>
95
+
96
+ <Typography level="title-lg" className="mt-6 mb-2">Payload:</Typography>
126
97
  <pre>{JSON.stringify(run.inputs, null, 2)}</pre>
127
- <Typography level="title-lg" sx={{
128
- mt: 3,
129
- mb: 1
130
- }}>Logs:</Typography>
131
- <Sheet sx={{
132
- bgcolor: 'white'
133
- }}>
134
- <Table borderAxis="xBetween" size="md" variant="outlined" sx={{
135
- border: '1px solid #d9dada',
136
- '--TableCell-borderColor': '#ebebeb'
137
- }}>
138
- <tbody>
139
- {logs.map((log, index) => <tr key={index}>
140
- <td style={{
141
- width: 90,
142
- padding: 7,
143
- paddingLeft: 14,
144
- verticalAlign: 'top',
145
- height: 'auto'
146
- }}>
147
- <Typography level="body-sm" fontFamily="monospace">
98
+
99
+ <Typography level="title-lg" className="mt-6 mb-2">Logs:</Typography>
100
+ <div className="bg-white border rounded-md">
101
+ <Table>
102
+ <TableBody>
103
+ {logs.map((log, index) => <TableRow key={index}>
104
+ <TableCell className="w-[90px] p-2 pl-4 align-top">
105
+ <Typography level="body-sm" className="font-mono">
148
106
  {new Date(log.created_at).toLocaleTimeString()}
149
107
  </Typography>
150
- </td>
151
- <td style={{
152
- padding: 7,
153
- verticalAlign: 'top',
154
- height: 'auto'
155
- }}>
156
- {log.type == 'markdown' ? <Alert variant='soft' color="primary" sx={{
157
- p: 2,
158
- pb: 0,
159
- // bgcolor:'#e3fbe3',
160
- bgcolor: '#f8ffff',
161
- color: '#276f85',
162
- border: '1px solid #a8d4dd',
163
- '& h4, & h3,': {
164
- mt: 0
165
- }
166
- }}>
167
- <div className='' dangerouslySetInnerHTML={{
108
+ </TableCell>
109
+ <TableCell className="p-2 align-top">
110
+ {log.type == 'markdown' ? <Alert className="bg-sky-50 border-sky-200 text-sky-800">
111
+ <AlertDescription>
112
+ <div dangerouslySetInnerHTML={{
168
113
  __html: log.content
169
114
  }} />
170
- </Alert> : log.type == 'json' ? <div style={{
171
- height: '300px',
172
- backgroundColor: '#e5d2fc',
173
- overflowY: 'scroll'
174
- }}>
175
- <pre className="json-renderer" style={{
176
- padding: 0,
177
- margin: 0
178
- }}>
115
+ </AlertDescription>
116
+ </Alert> : log.type == 'json' ? <div className="h-[300px] bg-purple-100 overflow-y-scroll">
117
+ <pre className="p-0 m-0">
179
118
  {JSON.stringify(JSON.parse(log.content), null, 2)}
180
119
  </pre>
181
- </div> : log.type == 'error' ? <Alert variant='soft' color="danger" sx={{
182
- p: 2,
183
- pb: 0,
184
- overflow: 'auto',
185
- '&::-webkit-scrollbar': {
186
- display: 'none'
187
- },
188
- scrollbarWidth: 'none',
189
- // Firefox
190
- msOverflowStyle: 'none',
191
- // IE and Edge
192
- // bgcolor:'#e3fbe3',
193
- // bgcolor:'#f8ffff',
194
- // color:'#276f85',
195
- border: '1px solid #e0b4b4',
196
- '& h4, & h3,': {
197
- mt: 0
198
- }
199
- }}>
200
- <div>
201
- <h4>Error : {JSON.parse(log.content)?.message}</h4>
202
- {JSON.parse(log.content)?.stack}
203
-
204
- </div>
205
- </Alert> : log.type == 'warn' ? <Alert variant='soft' color="warning" sx={{
206
- py: 1,
207
- my: -0.4
208
- }}>
209
- {log.content}
210
- </Alert> : log.type == 'info' ? <Alert variant='soft' color="primary" sx={{
211
- py: 1,
212
- my: -0.4
213
- }}>
214
- {log.content}
215
- </Alert> : log.type == 'danger' ? <Alert variant='soft' color="danger" sx={{
216
- py: 1,
217
- my: -0.4
218
- }}>
219
- {log.content}
220
- </Alert> : log.type == 'success' ? <Alert variant='soft' color="success" sx={{
221
- py: 1,
222
- my: -0.4
223
- }}>
224
- {log.content}
225
- </Alert> : <Typography level="body-sm" fontFamily="monospace">{log.content}</Typography>}
226
- </td>
227
- </tr>)}
228
- </tbody>
120
+ </div> : log.type == 'error' ? <Alert variant="destructive" className="overflow-auto scrollbar-hide">
121
+ <AlertDescription>
122
+ <h4 className="font-semibold">Error: {JSON.parse(log.content)?.message}</h4>
123
+ <pre className="text-xs mt-2 whitespace-pre-wrap">{JSON.parse(log.content)?.stack}</pre>
124
+ </AlertDescription>
125
+ </Alert> : log.type == 'warn' ? <Alert variant="warning" className="py-2">
126
+ <AlertDescription>{log.content}</AlertDescription>
127
+ </Alert> : log.type == 'info' ? <Alert className="py-2 bg-blue-50 border-blue-200 text-blue-800">
128
+ <AlertDescription>{log.content}</AlertDescription>
129
+ </Alert> : log.type == 'danger' ? <Alert variant="destructive" className="py-2">
130
+ <AlertDescription>{log.content}</AlertDescription>
131
+ </Alert> : log.type == 'success' ? <Alert variant="success" className="py-2">
132
+ <AlertDescription>{log.content}</AlertDescription>
133
+ </Alert> : <Typography level="body-sm" className="font-mono">{log.content}</Typography>}
134
+ </TableCell>
135
+ </TableRow>)}
136
+ </TableBody>
229
137
  </Table>
230
- </Sheet>
231
- <br />
232
- {/* <pre>{JSON.stringify(task,null,2)}</pre> */}
233
- {/* <pre>{JSON.stringify(run,null,2)}</pre> */}
234
- </Container>
235
- </>;
138
+ </div>
139
+ </div>;
236
140
  }
@@ -1,10 +1,8 @@
1
1
  'use client';
2
2
 
3
- import { Menu, MenuItem, MenuButton, Dropdown } from '@mui/joy';
4
- import * as React from 'react';
5
- import Button from '@mui/joy/Button';
6
- // import Divider from '@mui/joy/Divider';
7
-
3
+ import { EllipsisVertical } from 'lucide-react';
4
+ import { Button } from "../../../../../../../components/ui/button";
5
+ import { DropdownMenu, DropdownMenuContent, DropdownMenuItem, DropdownMenuTrigger } from "../../../../../../../components/ui/dropdown-menu";
8
6
  import { deleteRun } from "./action";
9
7
  export default function DropdownActions({
10
8
  run
@@ -22,25 +20,21 @@ export default function DropdownActions({
22
20
  const curlCommand = `curl -X POST "${baseUrl}?${queryParams.toString()}"`;
23
21
  await navigator.clipboard.writeText(curlCommand);
24
22
  }
25
- return <>
26
- <Dropdown size='sm'>
27
- <MenuButton aria-label="master-data more options" variant="outlined" color="primary" size="sm" sx={{
28
- // Add these styles to match IconButton
29
- aspectRatio: '1',
30
- // borderRadius: '50%',
31
- p: 0.5,
32
- display: 'inline-flex',
33
- alignItems: 'center',
34
- justifyContent: 'center'
35
- }} onClick={event => {
36
- event.preventDefault();
23
+ return <DropdownMenu>
24
+ <DropdownMenuTrigger asChild>
25
+ <Button variant="outline" size="icon" className="h-8 w-8" aria-label="more options" onClick={event => {
37
26
  event.stopPropagation();
38
- }}><i class="fa-solid fa-ellipsis-vertical fa-lg"></i></MenuButton>
39
- <Menu placement='bottom-end'>
40
- <MenuItem disabled onClick={onClickCreateVersion}>Rerun job</MenuItem>
41
- <MenuItem onClick={onClickCopyRerunAsCurl}>Copy rerun as curl</MenuItem>
42
- {/* <MenuItem color='danger' onClick={()=>{setOpen(true);}}>Delete Part</MenuItem> */}
43
- </Menu>
44
- </Dropdown>
45
- </>;
27
+ }}>
28
+ <EllipsisVertical className="h-4 w-4" />
29
+ </Button>
30
+ </DropdownMenuTrigger>
31
+ <DropdownMenuContent align="end">
32
+ <DropdownMenuItem disabled onClick={onClickCreateVersion}>
33
+ Rerun job
34
+ </DropdownMenuItem>
35
+ <DropdownMenuItem onClick={onClickCopyRerunAsCurl}>
36
+ Copy rerun as curl
37
+ </DropdownMenuItem>
38
+ </DropdownMenuContent>
39
+ </DropdownMenu>;
46
40
  }