You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
1.0 KiB
34 lines
1.0 KiB
import React, { useState } from "react"; |
|
import Button from "../Button"; |
|
import ButtonNewDesign from "../ButtonNewDesign"; |
|
import EditRow from "./EditRow"; |
|
|
|
const ViewEdit = ({ row }) => { |
|
const [selectedTab, setSelectedTab] = useState(false); |
|
return ( |
|
<div className="flex flex-row justify-end gap-x-2"> |
|
<div onClick={(e) => e.stopPropagation()}> |
|
<Button |
|
className={ |
|
"bg-blue-400 hover:bg-blue-600 text-white rounded text-xs p-3" |
|
} |
|
text={"نمایش"} |
|
{...row.getToggleRowExpandedProps()} |
|
/> |
|
</div> |
|
<div onClick={(e) => e.stopPropagation()}> |
|
<Button |
|
className={ |
|
"bg-transparent hover:bg-blue-600 hover:text-white border border-blue-600 text-blue-600 rounded text-xs p-3" |
|
} |
|
text={"ویرایش"} |
|
{...row.getToggleRowExpandedProps()} |
|
onClick={() => setSelectedTab(true)} |
|
/> |
|
</div> |
|
{selectedTab === true ? <EditRow row={row} /> : ""} |
|
</div> |
|
); |
|
}; |
|
|
|
export default ViewEdit;
|
|
|