import { useForm, Create } from "@refinedev/antd"; import { Input, Button, Form, notification } from "antd"; import { supabaseClient } from "../../utility"; // Ensure you have the correct path to your supabaseClient import { useNavigate } from "react-router-dom"; export const UserCreate: React.FC = () => { const { formProps, saveButtonProps } = useForm(); const onFinish = async (values: any) => { const { email, password, name } = values; try { const { data, error } = await supabaseClient.auth.signUp({ email, password, options: { data: { name, }, }, }); if (error) { throw error; } // Handle success (e.g., show notification, redirect) notification.success({ message: "User created successfully", }); } catch (error: any) { // Handle error (e.g., show error message) notification.error({ message: "Error creating user", description: error.message, }); } }; return (
); }; export default UserCreate;