"use client"
import {IconButton, Tooltip} from '@mui/material';
import RestartAltIcon from '@mui/icons-material/RestartAlt';
import useTableSetting from "@/lib/hooks/useTableSetting";
import {useState} from "react";

function RefactorTable() {
    const {refactorAction} = useTableSetting();
    const [userId, setUserId] = useState(0);
    const [pageName, setPageName] = useState('testPage');
    const [tableName, setTableName] = useState('testTable');

    const refactor = () => {
        refactorAction(userId, pageName, tableName);
    };

    return (
        <Tooltip title="بازنشانی اطلاعات">
            <IconButton onClick={refactor} aria-label="refactor table">
                <RestartAltIcon/>
            </IconButton>
        </Tooltip>
    );
}

export default RefactorTable;


