import React from "react";
import Button from "./Button.jsx";
// import styled from "styled-components";
export default function Table({ head, contents, contentKey, onClick, className, view, offset, limit}) {
const [modalOpen, setModalOpen] = React.useState(false);
const openModal = () => {
setModalOpen(true);
};
const [modalOpen2, setModalOpen2] = React.useState(false);
const openModal2 = () => {
setModalOpen2(true);
};
const buttonPrint = () => {
if(view == 'mySenior'){
return(
| )
}
else if(view == 'allSenior'){
return(
<>
|
|
>
)
}
}
return (
{head.map((i) => {
return {i} | ;
})}
{contents.slice(offset, offset + limit).map((i, index) => {
return (
{/* // {i.rn} |
// {i.user_name} |
// {i.user_phonenumber} |
// {i.user_gender} |
// {i.user_birth} |
// {i.user_address} |
// {buttonPrint()} */}
{contentKey.map((kes) => {
return (
<>
{i[kes]} |
>
)
})}
{buttonPrint()}
);
})}
);
}
// const TableStyled = styled.table`
// border-top: 2px solid #2d303f;
// border-bottom: 1px solid #e4dccf;
// /* &:hover {
// background-color: #e4dccf;
// } */
// `;
// const TrStyled = styled.tr`
// cursor: pointer;
// `;
// const ThStyled = styled.th`
// padding: 1rem 0;
// font-weight: bold;
// background-color: #f0ebe3;
// font-size: 1.4rem;
// text-align: center;
// `;
// const TdStyled = styled.td`
// padding: 1rem 0;
// border-top: 1px solid #ececec;
// text-align: center;
// font-size: 1.3rem;
// background-color: #ffffff;
// `;