2025-04-08 01:28:58 +08:00

32 lines
1.1 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { Modal } from 'antd';
import { create } from 'zustand';
interface PayModalStore {
open: boolean;
setOpen: (open: boolean) => void;
money: number;
setMoney: (money: number) => void;
}
export const usePayModalStore = create<PayModalStore>((set) => ({
open: false,
setOpen: (open: boolean) => set({ open }),
money: 0,
setMoney: (money: number) => set({ money }),
}));
export const PayModal = () => {
const { open, setOpen, money } = usePayModalStore();
return (
<Modal open={open} onCancel={() => setOpen(false)} maskClosable={false} footer={null}>
<div className='px-4 py-4 flex flex-col gap-4 select-none'>
<h2 className='text-2xl font-bold mb-4'></h2>
<p className='text-lg'>{money} </p>
<div className='flex gap-2'>
<button className='bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600 cursor-pointer'></button>
<button className='bg-blue-500 text-white px-4 py-2 rounded-md hover:bg-blue-600 cursor-pointer'></button>
</div>
</div>
</Modal>
);
};