import classNames from 'classnames' import { divide } from 'lodash' import React from 'react' import { IconDoneCheckout } from 'src/components/icons' import { CheckOutForm } from 'src/utils/types.utils' import s from './CheckoutCollapse.module.scss' interface CheckoutCollapseProps { visible: boolean id: number children: React.ReactNode title: string isEdit: boolean onClose?: (id:number) => void onOpen?: (id:number) => void onEditClick?:(id:number) => void note?:string } const CheckoutCollapse = ({ children, id, title, isEdit, visible, note, onOpen, onClose, onEditClick }: CheckoutCollapseProps) => { const handleTitleClick = () => { if(visible){ onClose && onClose(id) }else{ onOpen && onOpen(id) } } const handleEdit = () => { onEditClick && onEditClick(id) } return (
{isEdit?:id}
{title}
{isEdit &&
{'Edit'}
}
{(!visible && isEdit) && (
{note}
) }
{children}
) } export default CheckoutCollapse