1
0
mirror of https://github.com/kremalicious/metamask-extension.git synced 2024-11-28 23:06:37 +01:00
metamask-extension/ui/pages/confirmation/templates/flask/snap-alert/snap-alert.js
2023-04-03 18:04:30 +02:00

41 lines
997 B
JavaScript

import { mapToTemplate } from '../../../../../components/app/flask/snap-ui-renderer';
import { DelineatorType } from '../../../../../helpers/constants/flask';
function getValues(pendingApproval, t, actions) {
const {
snapName,
requestData: { content },
} = pendingApproval;
return {
content: [
{
element: 'Box',
key: 'snap-dialog-content-wrapper',
props: {
marginLeft: 4,
marginRight: 4,
},
children: {
element: 'SnapDelineator',
key: 'snap-delineator',
props: {
type: DelineatorType.Content,
snapName,
},
// TODO: Replace with SnapUIRenderer when we don't need to inject the input manually.
children: mapToTemplate(content),
},
},
],
submitText: t('ok'),
onSubmit: () => actions.resolvePendingApproval(pendingApproval.id, null),
};
}
const snapAlert = {
getValues,
};
export default snapAlert;