-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
video section notification init added🚨
- Loading branch information
Showing
8 changed files
with
65 additions
and
14 deletions.
There are no files selected for viewing
29 changes: 19 additions & 10 deletions
29
.../components/button/VideoButtonPatient.tsx → ...ents/button/VideoSectionButtonPatient.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 |
---|---|---|
@@ -1,44 +1,53 @@ | ||
'use client'; | ||
|
||
import React, { useState } from 'react'; | ||
import React, { memo, useState } from 'react'; | ||
import { ButtonV2 } from './ButtonV2'; | ||
import Image from 'next/image'; | ||
import { Badge } from '@/components/ui/badge' | ||
import VideoCallModal from '../models/VideoSectionsModel'; | ||
import { useGetSectionsInOneDayPatient } from '@/lib/hooks/video/usePatient'; | ||
import { Skeleton } from '../ui/skeleton'; | ||
|
||
const VideoButtonPatient = () => { | ||
const VideoSectionButtonPatient = () => { | ||
const { data: upcomingSections, isLoading } = useGetSectionsInOneDayPatient(); | ||
const [isModalOpen, setIsModalOpen] = useState(false); | ||
console.log(upcomingSections); | ||
|
||
if(isLoading) return <Skeleton className="w-10 h-10" /> | ||
|
||
const handleClick = () => { | ||
console.log('Video button clicked'); | ||
} | ||
|
||
|
||
return ( | ||
<> | ||
<ButtonV2 variant="ghost" size="icon" className="relative" onClick={handleClick}> | ||
{/* <Image | ||
<Image | ||
src="/assets/icons/utils/video.svg" | ||
width={20} | ||
height={20} | ||
alt="Video Calls" | ||
className="text-muted-foreground" | ||
/> | ||
{upcomingSections.length > 0 && ( | ||
{upcomingSections!.length > 0 && ( | ||
<Badge | ||
variant="destructive" | ||
className="absolute -right-1 -top-1 h-5 w-5 rounded-full p-0 text-xs flex items-center justify-center" | ||
> | ||
{upcomingSections.length} | ||
{upcomingSections!.length} | ||
</Badge> | ||
)} */} | ||
)} | ||
<span className="sr-only">View Upcoming Video Calls</span> | ||
</ButtonV2> | ||
{/* <VideoCallModal | ||
<VideoCallModal | ||
open={isModalOpen} | ||
setOpen={setIsModalOpen} | ||
sections={upcomingSections} | ||
sections={upcomingSections!} | ||
link="/video-call" | ||
/> */} | ||
/> | ||
</> | ||
) | ||
} | ||
|
||
export default VideoButtonPatient | ||
export default memo(VideoSectionButtonPatient) |
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
File renamed without changes.
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 { withTempBaseUrl } from "@/lib/utils/withTempBaseUrl"; | ||
import patientAxiosInstance from "../patient/authorizedRoutes"; | ||
import doctorAxiosInstance from "../doctor/authorizedRoutes"; | ||
|
||
const patientBaseUrl = `${process.env.NEXT_PUBLIC_API_URL}/video/patient`; | ||
const doctorBaseUrl = `${process.env.NEXT_PUBLIC_API_URL}/video/doctor`; | ||
|
||
export const getSectionsInOneDayPatient = async () => { | ||
const response = await withTempBaseUrl(patientAxiosInstance, patientBaseUrl, { | ||
method: "GET", | ||
url: `/day`, | ||
}); | ||
return response.data; | ||
}; | ||
|
||
export const getSectionsInOneDayDoctor = async () => { | ||
const response = await withTempBaseUrl(doctorAxiosInstance, doctorBaseUrl, { | ||
method: "GET", | ||
url: `/day`, | ||
}); | ||
return response.data; | ||
}; | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import { getSectionsInOneDayDoctor } from "@/lib/api/video"; | ||
import IVideoSection from "@/types/entities"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
|
||
export const useGetSectionsInOneDayDoctor = () => { | ||
return useQuery<IVideoSection[]>({ | ||
queryKey: ["section-day"], | ||
queryFn: () => getSectionsInOneDayDoctor(), | ||
}); | ||
}; |
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,10 @@ | ||
import { getSectionsInOneDayPatient } from "@/lib/api/video"; | ||
import IVideoSection from "@/types/entities"; | ||
import { useQuery } from "@tanstack/react-query"; | ||
|
||
export const useGetSectionsInOneDayPatient = () => { | ||
return useQuery<IVideoSection[]>({ | ||
queryKey: ["section-day"], | ||
queryFn: () => getSectionsInOneDayPatient(), | ||
}); | ||
}; |
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
1bd39fb
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Successfully deployed to the following URLs:
avm-care – ./
avm-care-sinans-projects-8d312afe.vercel.app
avm-care-git-main-sinans-projects-8d312afe.vercel.app
avm-care.vercel.app