mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-23 04:19:48 +00:00
Update components and constants folder
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { memo } from 'react';
|
||||
|
||||
// Styled
|
||||
import { StyledConfirmDelete } from './styled';
|
||||
|
||||
// Component
|
||||
import Button from '@commonStyle/Button';
|
||||
|
||||
interface IConfirmMessage {
|
||||
message: string;
|
||||
disabled: boolean;
|
||||
onConfirm: () => void;
|
||||
onCloseModal?: () => void;
|
||||
}
|
||||
|
||||
const ConfirmMessage = memo(
|
||||
({ message, disabled, onConfirm, onCloseModal }: IConfirmMessage) => {
|
||||
return (
|
||||
<StyledConfirmDelete>
|
||||
<p>{message}</p>
|
||||
|
||||
<div>
|
||||
<Button variations="danger" disabled={disabled} onClick={onConfirm}>
|
||||
Delete
|
||||
</Button>
|
||||
<Button
|
||||
variations="secondary"
|
||||
disabled={disabled}
|
||||
onClick={onCloseModal}
|
||||
>
|
||||
Cancel
|
||||
</Button>
|
||||
</div>
|
||||
</StyledConfirmDelete>
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
export default ConfirmMessage;
|
||||
@@ -0,0 +1,20 @@
|
||||
import styled from 'styled-components';
|
||||
|
||||
const StyledConfirmDelete = styled.div`
|
||||
width: 450px;
|
||||
|
||||
& p {
|
||||
font-size: var(--fs-sm);
|
||||
text-align: center;
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
|
||||
& div {
|
||||
display: flex;
|
||||
justify-content: space-around;
|
||||
|
||||
padding-inline: 50px;
|
||||
}
|
||||
`;
|
||||
|
||||
export { StyledConfirmDelete };
|
||||
Reference in New Issue
Block a user