import type { Component } from 'solid-js';
import { createSignal } from 'solid-js';
import {
SSAttrList,
SSButton,
SSCallout,
SSForm,
SSHeader,
SSModal,
SSSurface,
useSSModals,
} from 'src';
import { IconSpark } from '../../demo/content';
const ModalsPage: Component = () => {
const modals = useSSModals();
const [open, setOpen] = createSignal(false);
return (
setOpen(true)}>Open modal
modals.showDefault({
content: () => (
Delete pipeline?
This action will remove the pipeline and its history.
),
modalProps: () => ({
title: 'Delete confirmation',
danger: true,
primaryButtonText: 'Delete',
}),
})
}
>
Default modal
modals.showForm({
content: ({ context }) => (
{context.hasError() && (
Please fix the highlighted fields.
)}
),
modalProps: () => ({
title: 'Edit release',
primaryButtonText: 'Save',
}),
onSubmit: async ({ hide }) => {
hide();
},
})
}
>
Form modal
setOpen(false)}
footer={
<>
setOpen(false)}>
Cancel
setOpen(false)}>Confirm
>
}
>
}>
Everything is ready to go. Confirm to publish.
);
};
export default ModalsPage;