modified comments

parent 10251ddd
...@@ -3,7 +3,7 @@ import Loading from "../loading Component/Loading"; ...@@ -3,7 +3,7 @@ import Loading from "../loading Component/Loading";
function Table({headers, data,loading, maxHeight}) { function Table({headers, data,loading, maxHeight}) {
if(loading) return <Loading/> if(loading) return <Loading/>
if(data?.length)
return ( return (
<div className={` overflow-auto sm:rounded-lg p-4 max-h-[${maxHeight}vh] bg-gray-100`}> <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"> <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,6 +16,7 @@ function Table({headers, data,loading, maxHeight}) { ...@@ -16,6 +16,7 @@ function Table({headers, data,loading, maxHeight}) {
))} ))}
</tr> </tr>
</thead> </thead>
{ (data?.length)?
<tbody> <tbody>
{ {
data?.map((item, index) => ( data?.map((item, index) => (
...@@ -28,17 +29,20 @@ function Table({headers, data,loading, maxHeight}) { ...@@ -28,17 +29,20 @@ function Table({headers, data,loading, maxHeight}) {
</tr> </tr>
)) ))
} }
</tbody> </tbody>:null
}
</table> </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> (!data?.length)?<div className="w-full h-full">
</div>
</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> <p className="text-center align-middle pt-14 pb-14 text-blue-500 font-bold">No records to display</p>
</div>:null
}
</div> </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; export default Table;
...@@ -61,7 +61,9 @@ function Dashboard() { ...@@ -61,7 +61,9 @@ function Dashboard() {
{ {
title: "Employee Name", title: "Employee Name",
id: "empName", 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", title: "Emp.Id",
......
...@@ -48,10 +48,10 @@ function Reports() { ...@@ -48,10 +48,10 @@ function Reports() {
} }
} }
const getReports = (startDate = null, endDate = null) => { // const getReports = (startDate = null, endDate = null) => {
const data = { "empId": empId, "fromDate": startDate, "toDate": endDate } // const data = { "empId": empId, "fromDate": startDate, "toDate": endDate }
dispatch(fetchReports(data)) // dispatch(fetchReports(data))
} // }
const fetchLatestReporteesData = () => { const fetchLatestReporteesData = () => {
if (user) { if (user) {
const data = { const data = {
...@@ -74,7 +74,7 @@ function Reports() { ...@@ -74,7 +74,7 @@ function Reports() {
await axios.post(`${base_url}/createActivity`, newData) await axios.post(`${base_url}/createActivity`, newData)
.then(async (result) => { .then(async (result) => {
fetchLatestReporteesData() fetchLatestReporteesData()
getReports() // getReports()
}) })
} else { } else {
...@@ -156,14 +156,14 @@ function Reports() { ...@@ -156,14 +156,14 @@ function Reports() {
</div> </div>
</div> </div>
<div className="max-h-[70vh] overflow-auto"> <div className="">
<div className="container mx-auto mt-4 flex justify-end pe-4"> {/* <div className="container mx-auto mt-4 flex justify-end pe-4">
<DateRangePicker getReports={getReports} /> <DateRangePicker getReports={getReports} />
</div> </div> */}
<div className="max-h-[50vh] overflow-auto"> <div className="">
<Accordion title="Default" open={open.accordianOne} handleAccordian={handleAccordian} data={activities?.default} handleAddActivity={handleAddActivity} /> <Accordion title="Default" open={open.accordianOne} handleAccordian={handleAccordian} data={activities?.default} handleAddActivity={handleAddActivity} />
</div> </div>
<div className="max-h-[50vh] overflow-auto"> <div className="">
<Accordion title="Initiative" open={open.accordianTwo} handleAccordian={handleAccordian} data={activities?.initiative} handleAddActivity={handleAddActivity} /> <Accordion title="Initiative" open={open.accordianTwo} handleAccordian={handleAccordian} data={activities?.initiative} handleAddActivity={handleAddActivity} />
</div> </div>
</div> </div>
......
// export const base_url = 'http://localhost:4000' // export const base_url = 'http://localhost:4000'
// export const base_url = 'https://nisumscorecardserverdev.netlify.app/.netlify/functions/api' export const base_url = 'https://nisumscorecardserverdev.netlify.app/.netlify/functions/api'
export const base_url = 'https://nisumscorecardservertesting.netlify.app/.netlify/functions/api' // export const base_url = 'https://nisumscorecardservertesting.netlify.app/.netlify/functions/api'
\ No newline at end of file \ 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