-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Feat]: Add sortable headers to Timesheet component with dynamic sort…
…ing (#3367) * Add sortable headers to Timesheet component with dynamic sorting logic for columns * fix:deepscan * fix: coderabbitai * fix: coderabbitai
- Loading branch information
1 parent
528362c
commit 897ad04
Showing
6 changed files
with
191 additions
and
29 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
apps/web/app/[locale]/timesheet/[memberId]/components/TimesheetLoader.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import { BackdropLoader } from "@/lib/components"; | ||
import { useEffect, useState } from "react"; | ||
|
||
export function TimesheetLoader({ show = false }: { show?: boolean }) { | ||
const [dots, setDots] = useState(""); | ||
|
||
useEffect(() => { | ||
if (!show) { | ||
setDots(""); // Reset the dots when loader is hidden | ||
return; | ||
} | ||
|
||
const interval = setInterval(() => { | ||
setDots((prev) => (prev.length < 3 ? prev + "." : "")); | ||
}, 1000); // Update dots every second | ||
|
||
return () => clearInterval(interval); // Cleanup interval on unmount or when `show` changes | ||
}, [show]); | ||
|
||
return ( | ||
<BackdropLoader show={show} title={`Loading${dots}`} /> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters