modified comments

parent 10251ddd
......@@ -3,7 +3,7 @@ import Loading from "../loading Component/Loading";
function Table({headers, data,loading, maxHeight}) {
if(loading) return <Loading/>
if(data?.length)
return (
<div className={` overflow-auto sm:rounded-lg p-4 max-h-[${maxHeight}vh] bg-gray-100`}>
<table className="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 bg-transparent justify-center border-separate border-spacing-y-2">
......@@ -16,29 +16,33 @@ function Table({headers, data,loading, maxHeight}) {
))}
</tr>
</thead>
<tbody>
{
data?.map((item, index) => (
<tr className="bg-white dark:bg-gray-800 dark:border-gray-700 dark:text-white hover:bg-gray-50 dark:hover:bg-gray-600">
{
headers?.map(({render, id}) => (
<td className="px-6 py-4 listData" >{render ? render(item[id]) : item[id] === "" ? "NA" : item[id] }</td>
))
}
</tr>
))
}
</tbody>
{ (data?.length)?
<tbody>
{
data?.map((item, index) => (
<tr className="bg-white dark:bg-gray-800 dark:border-gray-700 dark:text-white hover:bg-gray-50 dark:hover:bg-gray-600">
{
headers?.map(({render, id}) => (
<td className="px-6 py-4 listData" >{render ? render(item[id]) : item[id] === "" ? "NA" : item[id] }</td>
))
}
</tr>
))
}
</tbody>:null
}
</table>
<div className={`w-full h-[30vh] justify-center bg-white mt-3 flex items-center rounded ${data?.lenght !== 0 && 'hidden'}`}>
<p className="text-lg">Reportees not assigned</p>
</div>
{
(!data?.length)?<div className="w-full h-full">
<p className="text-center align-middle pt-14 pb-14 text-blue-500 font-bold">No records to display</p>
</div>:null
}
</div>
);
else
return <div className="w-full h-full">
<p className="text-center align-middle pt-14 pb-14 text-blue-500 font-bold">No records to display</p>
</div>
// else
// return <div className="w-full h-full">
// <p className="text-center align-middle pt-14 pb-14 text-blue-500 font-bold">No records to display</p>
// </div>
}
export default Table;
......@@ -61,7 +61,9 @@ function Dashboard() {
{
title: "Employee Name",
id: "empName",
render: (value) => <span className="flex items-center"><img className="pr-2" src="/man.png" width="30px" height="30px" />{value}</span>
render: (value) => <span className="flex items-center">
{/* <img className="pr-2" src="/man.png" width="30px" height="30px" /> */}
{value}</span>
},
{
title: "Emp.Id",
......
......@@ -48,10 +48,10 @@ function Reports() {
}
}
const getReports = (startDate = null, endDate = null) => {
const data = { "empId": empId, "fromDate": startDate, "toDate": endDate }
dispatch(fetchReports(data))
}
// const getReports = (startDate = null, endDate = null) => {
// const data = { "empId": empId, "fromDate": startDate, "toDate": endDate }
// dispatch(fetchReports(data))
// }
const fetchLatestReporteesData = () => {
if (user) {
const data = {
......@@ -74,7 +74,7 @@ function Reports() {
await axios.post(`${base_url}/createActivity`, newData)
.then(async (result) => {
fetchLatestReporteesData()
getReports()
// getReports()
})
} else {
......@@ -156,14 +156,14 @@ function Reports() {
</div>
</div>
<div className="max-h-[70vh] overflow-auto">
<div className="container mx-auto mt-4 flex justify-end pe-4">
<div className="">
{/* <div className="container mx-auto mt-4 flex justify-end pe-4">
<DateRangePicker getReports={getReports} />
</div>
<div className="max-h-[50vh] overflow-auto">
</div> */}
<div className="">
<Accordion title="Default" open={open.accordianOne} handleAccordian={handleAccordian} data={activities?.default} handleAddActivity={handleAddActivity} />
</div>
<div className="max-h-[50vh] overflow-auto">
<div className="">
<Accordion title="Initiative" open={open.accordianTwo} handleAccordian={handleAccordian} data={activities?.initiative} handleAddActivity={handleAddActivity} />
</div>
</div>
......
// export const base_url = 'http://localhost:4000'
// export const base_url = 'https://nisumscorecardserverdev.netlify.app/.netlify/functions/api'
export const base_url = 'https://nisumscorecardservertesting.netlify.app/.netlify/functions/api'
\ No newline at end of file
export const base_url = 'https://nisumscorecardserverdev.netlify.app/.netlify/functions/api'
// export const base_url = 'https://nisumscorecardservertesting.netlify.app/.netlify/functions/api'
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment