diff --git a/.github/workflows/discord.yml b/.github/workflows/discord.yml new file mode 100644 index 0000000..e8812fb --- /dev/null +++ b/.github/workflows/discord.yml @@ -0,0 +1,70 @@ +name: Notify Discord + +on: + push: + branches: + - main + - backup-v1 + - dev + +jobs: + build: + runs-on: ubuntu-latest + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Send Notification + env: + DISCORD_WEBHOOK_URL: ${{ secrets.COMMIT_WEBHOOK_URL }} + + # --- Commit details --- + COMMIT_MESSAGE: ${{ github.event.head_commit.message }} + COMMIT_AUTHOR_NAME: ${{ github.event.head_commit.author.name }} + COMMIT_TIMESTAMP: ${{ github.event.head_commit.timestamp }} + COMMIT_URL: ${{ github.event.head_commit.url }} + + # --- Branch details --- + TARGET_BRANCH: ${{ github.ref_name }} + + # --- Pusher details (User who ran 'git push') --- + PUSHER_USERNAME: ${{ github.actor }} + PUSHER_AVATAR_URL: "https://github.com/${{ github.actor }}.png" + + run: | + discord_title="Push to '${TARGET_BRANCH}' on 'MTDOJRP/docs'" + + discord_description=$(cat < { +const [rosterData, setRosterData] = useState({ + sahp: [], + bcso: [], + lspd: [] +}); +const staticSahpRoster = [ + { callSign: '1C-01', rank: 'Colonel', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '1C-02', rank: 'Lieutenant colonel', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '1C-03', rank: 'Major', status: 'Vacant', role: 'Department Management', startDate: '', fto: '', hours: '' }, + { callSign: '1C-04', rank: 'Captain', status: 'Vacant', role: 'Division Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-05', rank: 'Lieutenant', status: 'Vacant', role: 'LIA Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1V-10', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1V-11', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1V-12', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '1U-16', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-17', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-18', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-19', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-20', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-21', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-22', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-23', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-24', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-25', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-26', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-27', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-28', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1U-29', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, + { callSign: '1N-30', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '1N-31', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '1N-32', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, +]; +const staticBcsoRoster = [ + { callSign: '2C-01', rank: 'Sheriff', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '2C-02', rank: 'Undersheriff', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '2C-03', rank: 'Chief Deputy', status: 'Vacant', role: 'Department Management', startDate: '', fto: '', hours: '' }, + { callSign: '1C-04', rank: 'Captain', status: 'Vacant', role: 'Division Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '2L-05', rank: 'Lieutenant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '2S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '2S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '2S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '2V-10', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2V-11', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2V-12', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, + { callSign: '2U-16', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-17', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-18', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-19', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-20', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-21', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-22', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-23', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-24', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-25', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-26', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-27', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-28', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2U-29', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, + { callSign: '2N-30', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '2N-31', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '2N-32', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' } +]; +const staticLspdRoster = [ + { callSign: '4C-01', rank: 'Chief', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '4C-02', rank: 'Asst. Chief', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '4C-03', rank: 'Captain', status: 'Vacant', role: 'Division Management', startDate: '', fto: '', hours: '' }, + { callSign: '1C-04', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4L-05', rank: 'Lieutenant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'TEU Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-10', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-11', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-12', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '4U-16', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-17', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-18', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-19', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-20', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-21', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-22', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-23', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-24', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-25', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-26', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-27', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-28', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4U-29', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '4N-30', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '4N-31', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '4N-32', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' } +]; + +useEffect(() => { +const fetchRosterData = async () => { + try { + const response = await fetch('https://api.kcdojrp.com/v1/roster'); + const data = await response.json(); + const apiRoster = data.response || []; + const mergeRosters = (staticRoster) => { + return staticRoster.map(staticEntry => { + const dynamicEntry = apiRoster.find(entry => entry.callsign === staticEntry.callSign); + return dynamicEntry + ? { + ...staticEntry, + name: dynamicEntry.name, + rank: dynamicEntry.rank, + role: dynamicEntry.position, + startDate: dynamicEntry.startDate, + status: dynamicEntry.suspended === "false" ? "Active" : "Suspended", + hours: dynamicEntry.hours + } + : staticEntry; + }); + }; + setRosterData({ + sahp: mergeRosters(staticSahpRoster), + bcso: mergeRosters(staticBcsoRoster), + lspd: mergeRosters(staticLspdRoster) + }); + } catch (error) { + console.error('Error fetching roster data:', error); + } + }; + fetchRosterData(); +}, []); + +const renderTable = (roster) => ( + + + + + + + + + + + + + + + {roster.map((member, index) => ( + + + + + + + + + + + ))} + +
Call SignNameRankStatusRole/DetailStart DateFTOHours
{member.callSign}{member.name || ''}{member.rank}{member.status}{member.role}{member.startDate || ''}{member.fto || ''}{member.hours || ''}
+); + +return ( + + {renderTable(rosterData.sahp)} + {renderTable(rosterData.bcso)} + {renderTable(rosterData.lspd)} + +); +}; + +export default Roster; diff --git a/src/components/Roster.js b/src/components/Roster.js index 4c5c907..725d7fb 100644 --- a/src/components/Roster.js +++ b/src/components/Roster.js @@ -4,17 +4,15 @@ import TabItem from '@theme/TabItem'; const Roster = () => { const [rosterData, setRosterData] = useState({ - sahp: [], - bcso: [], - lspd: [] + dps: [], }); -const staticSahpRoster = [ - { callSign: '1C-01', rank: 'Colonel', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, - { callSign: '1C-02', rank: 'Lieutenant colonel', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, +const staticDpsRoster = [ + { callSign: '1C-01', rank: 'Commissioner', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, + { callSign: '1C-02', rank: 'Asst. Commissioner', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, { callSign: '1C-03', rank: 'Major', status: 'Vacant', role: 'Department Management', startDate: '', fto: '', hours: '' }, - { callSign: '1C-04', rank: 'Captain', status: 'Vacant', role: 'Division Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '1L-05', rank: 'Lieutenant', status: 'Vacant', role: 'LIA Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1C-04', rank: 'Captain', status: 'Vacant', role: 'Department Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-05', rank: 'Lieutenant', status: 'Vacant', role: 'Department Supervisor', startDate: '', fto: '', hours: '' }, + { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'Department Supervisor', startDate: '', fto: '', hours: '' }, { callSign: '1S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, { callSign: '1S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, { callSign: '1S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, @@ -24,91 +22,23 @@ const staticSahpRoster = [ { callSign: '1V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, { callSign: '1V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, { callSign: '1V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '1U-16', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-17', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-18', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-19', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-20', rank: 'Senior Trooper', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-21', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-22', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-23', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-24', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-25', rank: 'Trooper 1st Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-26', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-27', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-28', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1U-29', rank: 'Trooper 2nd Class', status: 'Vacant', role: 'Patrol Trooper', startDate: '', fto: '', hours: '' }, - { callSign: '1N-30', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '1N-31', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '1N-32', rank: 'Probationary Trooper', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, -]; -const staticBcsoRoster = [ - { callSign: '2C-01', rank: 'Sheriff', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, - { callSign: '2C-02', rank: 'Undersheriff', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, - { callSign: '2C-03', rank: 'Chief Deputy', status: 'Vacant', role: 'Department Management', startDate: '', fto: '', hours: '' }, - { callSign: '1C-04', rank: 'Captain', status: 'Vacant', role: 'Division Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '2L-05', rank: 'Lieutenant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '2S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '2S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '2S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '2V-10', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2V-11', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2V-12', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Lead', startDate: '', fto: '', hours: '' }, - { callSign: '2U-16', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-17', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-18', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-19', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-20', rank: '1st Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-21', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-22', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-23', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-24', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-25', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-26', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-27', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-28', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2U-29', rank: '2nd Class Deputy', status: 'Vacant', role: 'Patrol Deputy', startDate: '', fto: '', hours: '' }, - { callSign: '2N-30', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '2N-31', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '2N-32', rank: 'Probationary Deputy', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' } -]; -const staticLspdRoster = [ - { callSign: '4C-01', rank: 'Chief', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, - { callSign: '4C-02', rank: 'Asst. Chief', status: 'Vacant', role: 'Department Head', startDate: '', fto: '', hours: '' }, - { callSign: '4C-03', rank: 'Captain', status: 'Vacant', role: 'Division Management', startDate: '', fto: '', hours: '' }, - { callSign: '1C-04', rank: 'Lieutenant', status: 'Vacant', role: 'FTO Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4L-05', rank: 'Lieutenant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '1L-06', rank: 'Lieutenant', status: 'Vacant', role: 'TEU Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4S-07', rank: 'Sergeant', status: 'Vacant', role: 'Patrol Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4S-08', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4S-09', rank: 'Sergeant', status: 'Vacant', role: 'Shift Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-10', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-11', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-12', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-13', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-14', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4V-15', rank: 'Corporal', status: 'Vacant', role: 'Road Supervisor', startDate: '', fto: '', hours: '' }, - { callSign: '4U-16', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-17', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-18', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-19', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-20', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-21', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-22', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-23', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-24', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-25', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-26', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-27', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-28', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4U-29', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, - { callSign: '4N-30', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '4N-31', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, - { callSign: '4N-32', rank: 'Probationary Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' } + { callSign: '1U-16', rank: 'Senior Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-17', rank: 'Senior Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-18', rank: 'Senior Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-19', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-20', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-21', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-22', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-23', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-24', rank: '1st Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-25', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-26', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-27', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-28', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1U-29', rank: '2nd Class Officer', status: 'Vacant', role: 'Patrol Officer', startDate: '', fto: '', hours: '' }, + { callSign: '1N-30', rank: '3nd Class Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '1N-31', rank: '3nd Class Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, + { callSign: '1N-32', rank: '3nd Class Officer', status: 'Vacant', role: 'Probationary', startDate: '', fto: '', hours: '' }, ]; useEffect(() => { @@ -127,16 +57,14 @@ const fetchRosterData = async () => { rank: dynamicEntry.rank, role: dynamicEntry.position, startDate: dynamicEntry.startDate, - status: dynamicEntry.suspended === "false" ? "Active" : "Suspended", + status: dynamicEntry.suspended === "false" ? "Active" : "On Leave", hours: dynamicEntry.hours } : staticEntry; }); }; setRosterData({ - sahp: mergeRosters(staticSahpRoster), - bcso: mergeRosters(staticBcsoRoster), - lspd: mergeRosters(staticLspdRoster) + dps: mergeRosters(staticDpsRoster) }); } catch (error) { console.error('Error fetching roster data:', error); @@ -177,14 +105,10 @@ const renderTable = (roster) => ( ); return ( - - {renderTable(rosterData.sahp)} - {renderTable(rosterData.bcso)} - {renderTable(rosterData.lspd)} + {renderTable(rosterData.dps)} ); };