diff --git a/app/[locale]/(protected)/app/calendar/calender-view.tsx b/app/[locale]/(protected)/app/calendar/calender-view.tsx deleted file mode 100644 index 4e49d138..00000000 --- a/app/[locale]/(protected)/app/calendar/calender-view.tsx +++ /dev/null @@ -1,243 +0,0 @@ -"use client"; -import React, { useState, useEffect } from "react"; -import FullCalendar from "@fullcalendar/react"; // must go before plugins -import dayGridPlugin from "@fullcalendar/daygrid"; -import timeGridPlugin from "@fullcalendar/timegrid"; -import interactionPlugin, { Draggable } from "@fullcalendar/interaction"; -import listPlugin from "@fullcalendar/list"; -import { Button } from "@/components/ui/button"; -import { Label } from "@/components/ui/label"; -import ExternalDraggingevent from "./dragging-events"; -import { Calendar } from "@/components/ui/calendar"; -import { Card, CardContent, CardHeader } from "@/components/ui/card"; -import { Plus } from "lucide-react"; -import { Checkbox } from "@/components/ui/checkbox"; -import { CalendarEvent, CalendarCategory } from "./data" -import { - EventContentArg, -} from '@fullcalendar/core' -import EventModal from "./event-modal"; -import { useTranslations } from "next-intl"; -const wait = () => new Promise((resolve) => setTimeout(resolve, 1000)); -interface CalendarViewProps { - events: CalendarEvent[]; - categories: CalendarCategory[]; - - -} - -const CalendarView = ({ events, categories }: CalendarViewProps) => { - const [selectedCategory, setSelectedCategory] = useState(null); - const [selectedEventDate, setSelectedEventDate] = useState(null); - const [selectedEvent, setSelectedEvent] = useState(null); - const [draggableInitialized, setDraggableInitialized] = useState(false); -const t = useTranslations("CalendarApp") - // event canvas state - const [sheetOpen, setSheetOpen] = useState(false); - const [date, setDate] = React.useState(new Date()); - - const [dragEvents] = useState([ - { title: "New Event Planning", id: "101", tag: "business" }, - { title: "Meeting", id: "102", tag: "meeting" }, - { title: "Generating Reports", id: "103", tag: "holiday" }, - { title: "Create New theme", id: "104", tag: "etc" }, - ]); - - useEffect(() => { - setSelectedCategory(categories?.map((c) => c.value)); - }, [events, categories]); - - useEffect(() => { - const draggableEl = document.getElementById("external-events"); - - const initDraggable = () => { - if (draggableEl) { - new Draggable(draggableEl, { - itemSelector: ".fc-event", - eventData: function (eventEl) { - let title = eventEl.getAttribute("title"); - let id = eventEl.getAttribute("data"); - let event = dragEvents.find((e) => e.id === id); - let tag = event ? event.tag : ""; - return { - title: title, - id: id, - extendedProps: { - calendar: tag, - }, - }; - }, - }); - } - }; - - if (dragEvents.length > 0) { - initDraggable(); - } - - return () => { - draggableEl?.removeEventListener("mousedown", initDraggable); - }; - }, [dragEvents]); - // event click - const handleEventClick = (arg: any) => { - setSelectedEventDate(null); - setSheetOpen(true); - setSelectedEvent(arg); - wait().then(() => (document.body.style.pointerEvents = "auto")); - }; - // handle close modal - const handleCloseModal = () => { - setSheetOpen(false); - setSelectedEvent(null); - setSelectedEventDate(null); - }; - const handleDateClick = (arg: any) => { - setSheetOpen(true); - setSelectedEventDate(arg); - setSelectedEvent(null); - wait().then(() => (document.body.style.pointerEvents = "auto")); - }; - - const handleCategorySelection = (category: string) => { - if (selectedCategory && selectedCategory.includes(category)) { - setSelectedCategory(selectedCategory.filter((c) => c !== category)); - } else { - setSelectedCategory([...selectedCategory || [], category]); - } - }; - - const handleClassName = (arg: EventContentArg) => { - - if (arg.event.extendedProps.calendar === "holiday") { - return "destructive"; - } - else if (arg.event.extendedProps.calendar === "business") { - return "primary"; - } else if (arg.event.extendedProps.calendar === "personal") { - return "success"; - } else if (arg.event.extendedProps.calendar === "family") { - return "info"; - } else if (arg.event.extendedProps.calendar === "etc") { - return "info"; - } else if (arg.event.extendedProps.calendar === "meeting") { - return "warning"; - } - else { - return "primary"; - } - - }; - - const filteredEvents = events?.filter((event) => - selectedCategory?.includes(event.extendedProps.calendar) - ); - - return ( - <> -
- - - - - -
- { - handleDateClick(s); - }} - className="rounded-md border w-full p-0 border-none" - /> -
- -
-

- {t("shortDesc", { defaultValue: "Short Desc" })} -

- {dragEvents.map((event) => ( - - ))} -
-
- {t("filter", { defaultValue: "Filter" })} -
-
    -
  • - { - if (selectedCategory?.length === categories?.length) { - setSelectedCategory([]); - } else { - setSelectedCategory(categories.map((c) => c.value)); - } - }} - /> - -
  • - {categories?.map((category) => ( -
  • - handleCategorySelection(category.value)} - /> - -
  • - ))} -
-
-
- - - - - - -
- - - ); -}; - -export default CalendarView; diff --git a/app/[locale]/(protected)/app/calendar/data.ts b/app/[locale]/(protected)/app/calendar/data.ts deleted file mode 100644 index 398810f4..00000000 --- a/app/[locale]/(protected)/app/calendar/data.ts +++ /dev/null @@ -1,153 +0,0 @@ -const date = new Date(); -const prevDay = new Date().getDate() - 1; -const nextDay = new Date(new Date().getTime() + 24 * 60 * 60 * 1000); - -// prettier-ignore -const nextMonth = date.getMonth() === 11 ? new Date(date.getFullYear() + 1, 0, 1) : new Date(date.getFullYear(), date.getMonth() + 1, 1) -// prettier-ignore -const prevMonth = date.getMonth() === 11 ? new Date(date.getFullYear() - 1, 0, 1) : new Date(date.getFullYear(), date.getMonth() - 1, 1) -export const calendarEvents = [ - { - id: "calendar-all-day-event-001", - title: "All Day Event", - start: date, - end: nextDay, - allDay: false, - //className: "warning", - extendedProps: { - calendar: "business", - }, - }, - { - id: "calendar-meeting-client-002", - title: "Meeting With Client", - start: new Date(date.getFullYear(), date.getMonth() + 1, -11), - end: new Date(date.getFullYear(), date.getMonth() + 1, -10), - allDay: true, - //className: "success", - extendedProps: { - calendar: "personal", - }, - }, - { - id: "calendar-lunch-003", - title: "Lunch", - allDay: true, - start: new Date(date.getFullYear(), date.getMonth() + 1, -9), - end: new Date(date.getFullYear(), date.getMonth() + 1, -7), - // className: "info", - extendedProps: { - calendar: "family", - }, - }, - { - id: "calendar-birthday-party-004", - title: "Birthday Party", - start: new Date(date.getFullYear(), date.getMonth() + 1, -11), - end: new Date(date.getFullYear(), date.getMonth() + 1, -10), - allDay: true, - //className: "primary", - extendedProps: { - calendar: "meeting", - }, - }, - { - id: "calendar-birthday-party-005", - title: "Birthday Party", - start: new Date(date.getFullYear(), date.getMonth() + 1, -13), - end: new Date(date.getFullYear(), date.getMonth() + 1, -12), - allDay: true, - // className: "danger", - extendedProps: { - calendar: "holiday", - }, - }, - { - id: "calendar-monthly-meeting-006", - title: "Monthly Meeting", - start: nextMonth, - end: nextMonth, - allDay: true, - //className: "primary", - extendedProps: { - calendar: "business", - }, - }, -]; - -export const calendarCategories = [ - { - label: "Business", - value: "business", - activeClass: "ring-primary-500 bg-primary-500", - className: "group-hover:border-blue-500", - }, - { - label: "Personal", - value: "personal", - activeClass: "ring-success-500 bg-success-500", - className: " group-hover:border-green-500", - }, - { - label: "Holiday", - value: "holiday", - activeClass: "ring-danger-500 bg-danger-500", - className: " group-hover:border-red-500", - }, - { - label: "Family", - value: "family", - activeClass: "ring-info-500 bg-info-500", - className: " group-hover:border-cyan-500", - }, - { - label: "Meeting", - value: "meeting", - activeClass: "ring-warning-500 bg-warning-500", - className: " group-hover:border-yellow-500", - }, - { - label: "Etc", - value: "etc", - activeClass: "ring-info-500 bg-info-500", - className: " group-hover:border-cyan-500", - } -]; - -export const categories = [ - { - label: "Business", - value: "business", - className: "data-[state=checked]:bg-primary data-[state=checked]:ring-primary", - }, - { - label: "Personal", - value: "personal", - - className: "data-[state=checked]:bg-success data-[state=checked]:ring-success", - }, - { - label: "Holiday", - value: "holiday", - className: "data-[state=checked]:bg-destructive data-[state=checked]:ring-destructive ", - }, - { - label: "Family", - value: "family", - className: "data-[state=checked]:bg-info data-[state=checked]:ring-info ", - }, - { - label: "Meeting", - value: "meeting", - className: "data-[state=checked]:bg-warning data-[state=checked]:ring-warning", - }, - { - label: "Etc", - value: "etc", - className: "data-[state=checked]:bg-info data-[state=checked]:ring-info", - } -]; - -export type CalendarEvent = (typeof calendarEvents)[number] -export type CalendarCategory = (typeof calendarCategories)[number] -export type Category = (typeof categories)[number] \ No newline at end of file diff --git a/app/[locale]/(protected)/app/calendar/dragging-events.tsx b/app/[locale]/(protected)/app/calendar/dragging-events.tsx deleted file mode 100644 index 56683eaa..00000000 --- a/app/[locale]/(protected)/app/calendar/dragging-events.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { cn } from "@/lib/utils"; -const ExternalDraggingevent = ({ event }: any) => { - const { title, id, tag } = event; - - return ( -
- - {title} -
- ); -}; - -export default ExternalDraggingevent; diff --git a/app/[locale]/(protected)/app/calendar/event-modal.tsx b/app/[locale]/(protected)/app/calendar/event-modal.tsx deleted file mode 100644 index 87ebc61f..00000000 --- a/app/[locale]/(protected)/app/calendar/event-modal.tsx +++ /dev/null @@ -1,285 +0,0 @@ -"use client"; -import React, { useState, useEffect } from "react"; -import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; -import { Label } from "@/components/ui/label"; -import { useForm, Controller } from "react-hook-form"; -import { cn } from "@/lib/utils"; -import { format } from "date-fns"; -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/components/ui/popover"; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from "@/components/ui/select"; -import { Calendar } from "@/components/ui/calendar"; -import { zodResolver } from "@hookform/resolvers/zod"; -import { z } from "zod"; -import { Loader2, CalendarIcon } from "lucide-react"; -import DeleteConfirmationDialog from "@/components/delete-confirmation-dialog"; -import { CalendarCategory } from "./data"; -import { - Dialog, - DialogContent, - DialogHeader, - DialogTitle, -} from "@/components/ui/dialog"; - -const schema = z.object({ - title: z.string().min(3, { message: "Required" }), -}); - -const EventModal = ({ - open, - onClose, - categories, - event, - selectedDate, -}: { - open: boolean; - onClose: () => void; - categories: any; - event: any; - selectedDate: any; -}) => { - const [startDate, setStartDate] = useState(new Date()); - const [endDate, setEndDate] = useState(new Date()); - const [isPending, startTransition] = React.useTransition(); - const [calendarProps, setCalendarProps] = React.useState( - categories[0].value - ); - // delete modal state - const [deleteModalOpen, setDeleteModalOpen] = useState(false); - const [eventIdToDelete, setEventIdToDelete] = useState(null); - - const { - register, - control, - reset, - setValue, - formState: { errors }, - handleSubmit, - } = useForm({ - resolver: zodResolver(schema), - mode: "all", - }); - - const onSubmit = (data: any) => { - startTransition(() => { - if (!event) { - data.start = startDate; - data.end = endDate; - data.allDay = false; - data.extendedProps = { - calendar: calendarProps, - }; - } - if (event) { - } - }); - }; - useEffect(() => { - if (selectedDate) { - setStartDate(selectedDate.date); - setEndDate(selectedDate.date); - } - if (event) { - setStartDate(event?.event?.start); - setEndDate(event?.event?.end); - const eventCalendar = event?.event?.extendedProps?.calendar; - if (eventCalendar) { - setCalendarProps(eventCalendar); - } else { - setCalendarProps(categories[0].value); - } - } - setValue("title", event?.event?.title || ""); - }, [event, selectedDate, open, categories, setValue]); - - const onDeleteEventAction = async () => { - try { - } catch (error) {} - }; - - const handleOpenDeleteModal = (eventId: string) => { - setEventIdToDelete(eventId); - setDeleteModalOpen(true); - onClose(); - }; - - return ( - <> - setDeleteModalOpen(false)} - onConfirm={onDeleteEventAction} - defaultToast={false} - /> - - - - - {event ? "Edit Event" : "Create Event"} {event?.title} - - -
-
-
-
- - - {errors?.title?.message && ( -
- {typeof errors?.title?.message === "string" - ? errors?.title?.message - : JSON.stringify(errors?.title?.message)} -
- )} -
- -
- - - - - - - ( - setStartDate(date as Date)} - initialFocus - /> - )} - /> - - -
-
- - - - - - - ( - setEndDate(date as Date)} - initialFocus - /> - )} - /> - - -
- -
- - ( - - )} - /> -
-
- -
- - {event && ( - - )} -
-
-
-
-
- - ); -}; - -export default EventModal; diff --git a/app/[locale]/(protected)/app/calendar/layout.tsx b/app/[locale]/(protected)/app/calendar/layout.tsx deleted file mode 100644 index dae6bbc9..00000000 --- a/app/[locale]/(protected)/app/calendar/layout.tsx +++ /dev/null @@ -1,9 +0,0 @@ -export const metadata = { - title: "Calender", -}; - -const Layout = ({ children }: { children: React.ReactNode }) => { - return <>{children}; -}; - -export default Layout; diff --git a/app/[locale]/(protected)/app/calendar/page.tsx b/app/[locale]/(protected)/app/calendar/page.tsx deleted file mode 100644 index 266a6f7b..00000000 --- a/app/[locale]/(protected)/app/calendar/page.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { getEvents, getCategories } from "./utils"; -import { Category } from "./data" -import CalendarView from "./calender-view"; - - - -const CalenderPage = async () => { - const events = await getEvents(); - const categories = await getCategories(); - const formattedCategories = categories.map((category: Category) => ({ - ...category, - activeClass: "", - })); - return ( -
- -
- ); -}; - -export default CalenderPage; diff --git a/app/[locale]/(protected)/app/calendar/utils.ts b/app/[locale]/(protected)/app/calendar/utils.ts deleted file mode 100644 index e4862dd2..00000000 --- a/app/[locale]/(protected)/app/calendar/utils.ts +++ /dev/null @@ -1,11 +0,0 @@ -import { calendarEvents, categories } from "./data"; - -// get events -export const getEvents = async () => { - return calendarEvents; -}; - -// get categories -export const getCategories = async () => { - return categories; -} \ No newline at end of file diff --git a/app/[locale]/(protected)/app/chat/[id]/components/chat-header.tsx b/app/[locale]/(protected)/app/chat/[id]/components/chat-header.tsx deleted file mode 100644 index be240857..00000000 --- a/app/[locale]/(protected)/app/chat/[id]/components/chat-header.tsx +++ /dev/null @@ -1,123 +0,0 @@ -"use client"; -import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; -import { Badge } from "@/components/ui/badge"; -import { Button } from "@/components/ui/button"; -import { cn } from "@/lib/utils"; -import { Icon } from "@/components/ui/icon"; -import { - Tooltip, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; -import { useMediaQuery } from "@/hooks/use-media-query"; -import { Contact, ProfileUser } from "@/app/api/chat/data"; -import { useChatConfig } from "@/hooks/use-chat"; - -const ChatHeader = ({ contact }: { contact: any }) => { - let active = true; - const isLg = useMediaQuery("(max-width: 1024px)"); - - const [chatConfig, setChatConfig] = useChatConfig() - - return ( -
-
- {isLg && ( - - )} -
- - - {contact?.fullName?.slice(0, 2)} - - -
-
-
- {contact?.fullName} -
-
- {active ? "Active Now" : "Offline"} -
-
-
-
- - - - - - -

Start a voice call

-
-
-
- - - - - - -

Start a video call

-
-
-
- {!isLg && ( - - - - - - -

Conversation information

-
-
-
- )} -
-
- ); -}; - -export default ChatHeader; diff --git a/app/[locale]/(protected)/app/chat/[id]/components/info-wrapper.tsx b/app/[locale]/(protected)/app/chat/[id]/components/info-wrapper.tsx deleted file mode 100644 index c4c21b7b..00000000 --- a/app/[locale]/(protected)/app/chat/[id]/components/info-wrapper.tsx +++ /dev/null @@ -1,20 +0,0 @@ -'use client' - -import React from 'react' -import { Card, CardContent } from "@/components/ui/card"; -import { useChatConfig } from '@/hooks/use-chat'; -import { ScrollArea } from '@/components/ui/scroll-area'; - -const InfoWrapper = ({ children }: { children: React.ReactNode }) => { - const [chatConfig] = useChatConfig(); - if (!chatConfig.showInfo) return null - return ( - - - {children} - - - ) -} - -export default InfoWrapper \ No newline at end of file diff --git a/app/[locale]/(protected)/app/chat/[id]/components/message-footer.tsx b/app/[locale]/(protected)/app/chat/[id]/components/message-footer.tsx deleted file mode 100644 index 3132f927..00000000 --- a/app/[locale]/(protected)/app/chat/[id]/components/message-footer.tsx +++ /dev/null @@ -1,143 +0,0 @@ -"use client"; -import React, { useState } from "react"; -import { Button } from "@/components/ui/button"; -import { Input } from "@/components/ui/input"; -import { Icon } from "@/components/ui/icon"; -import { Annoyed, SendHorizontal } from "lucide-react"; - -// import data from "@emoji-mart/data"; -// import Picker from "@emoji-mart/react"; -import { - Tooltip, - TooltipArrow, - TooltipContent, - TooltipProvider, - TooltipTrigger, -} from "@/components/ui/tooltip"; -import { Label } from "@/components/ui/label"; - -import { - Popover, - PopoverContent, - PopoverTrigger, -} from "@/components/ui/popover"; -import { postMessageAction } from "@/action/app-actions"; -import { useTheme } from "next-themes"; - -const MessageFooter = () => { - const { theme: mode } = useTheme(); - const [message, setMessage] = useState(""); - const handleChange = (e: React.ChangeEvent) => { - setMessage(e.target.value); - e.target.style.height = "auto"; // Reset the height to auto to adjust - e.target.style.height = `${e.target.scrollHeight - 15}px`; - }; - - const handleSelectEmoji = (emoji: any) => { - setMessage(message + emoji.native); - }; - - const handleSubmit = async (e: React.FormEvent) => { - e.preventDefault(); - if (!message) return; - const data: any = { - message, - }; - - await postMessageAction("55fe838e-9a09-4caf-a591-559803309ef1", "sfsfsf"); - setMessage(""); - - - }; - return ( - <> - - -
-
- - - - - - -

Add link

-
-
-
- - - - - - - {/* */} - - - -
-
-
-
- -
-
- ); -}; - -export default BasicTextarea; \ No newline at end of file diff --git a/app/[locale]/(protected)/forms/textarea/colors-textarea.tsx b/app/[locale]/(protected)/forms/textarea/colors-textarea.tsx deleted file mode 100644 index c40e18ee..00000000 --- a/app/[locale]/(protected)/forms/textarea/colors-textarea.tsx +++ /dev/null @@ -1,18 +0,0 @@ - -import { Textarea } from "@/components/ui/textarea"; - -const ColorsTextarea = () => { - return ( -
- -
-
- ); -}; - -export default BasicTextarea;` - -export const colorsTextarea=` -import { Textarea } from "@/components/ui/textarea"; - -const ColorsTextarea = () => { - return ( -
-