Closed tamertwitter closed 3 months ago
Okay I get it.
I added to component from my action and more global think...
import React from 'react';
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import { Box, H5, Button, Text } from '@adminjs/design-system';
// import { ActionProps } from 'adminjs';
const RedirectToUrlAction = (props: any) => {
const { record, msg } = props;
// redirect to the URL to 5 seconds
setTimeout(() => {
window.location = record.params.url;
}, 3 * 1000);
return (
<Box>
<H5>{record.params.msg}</H5>
<Box>
<Text textAlign="center">
<Button href={record.params.url}>
Link to Request
</Button>
</Text>
</Box>
</Box>
);
};
export default RedirectToUrlAction;
Description
I try redirect but it is not work.
response:
http://localhost:3000/admin/resources/user/http://google.com?refresh=true
Suggested Solution
Alternatives
No response
Additional Context
No response