diff --git a/www/app/[domain]/browse/page.tsx b/www/app/[domain]/browse/page.tsx index 6303f1a0..443c50ff 100644 --- a/www/app/[domain]/browse/page.tsx +++ b/www/app/[domain]/browse/page.tsx @@ -4,6 +4,7 @@ import React, { useState } from "react"; import { GetTranscript } from "../../api"; import Pagination from "./pagination"; import Link from "next/link"; +import { FaGear } from "react-icons/fa6"; import { FaCheck, FaTrash, FaStar, FaMicrophone } from "react-icons/fa"; import { MdError } from "react-icons/md"; import useTranscriptList from "../transcripts/useTranscriptList"; @@ -31,6 +32,7 @@ import { PopoverHeader, PopoverBody, PopoverFooter, + IconButton, } from "@chakra-ui/react"; import { PlusSquareIcon } from "@chakra-ui/icons"; // import { useFiefUserinfo } from "@fief/fief/nextjs/react"; @@ -39,7 +41,6 @@ export default function TranscriptBrowser() { const [page, setPage] = useState(1); const { loading, response, refetch } = useTranscriptList(page); const [deletionLoading, setDeletionLoading] = useState(false); - const [deletedItems, setDeletedItems] = useState([]); const api = useApi(); const { setError } = useError(); @@ -67,18 +68,14 @@ export default function TranscriptBrowser() { ); - const prevent = (e: React.MouseEvent) => { - e.stopPropagation(); - e.preventDefault(); - }; - const handleDeleteTranscript = (transcriptToDeleteId) => (e) => { - if (!deletionLoading) { + e.stopPropagation(); + if (api && !deletionLoading) { + setDeletionLoading(true); api - ?.v1TranscriptDelete(transcriptToDeleteId) + .v1TranscriptDelete(transcriptToDeleteId) .then(() => { setDeletionLoading(false); - setDeletedItems([...deletedItems, transcriptToDeleteId]); refetch(); }) .catch((err) => { @@ -101,7 +98,7 @@ export default function TranscriptBrowser() { {/* {user?.fields?.name}'s Meetings */} Your Meetings - {loading && } + {loading || (deletionLoading && )} - {response?.items - .filter((item) => !deletedItems.includes(item.id)) - .map((item: GetTranscript) => ( - - - - {item.title || item.name || "Unamed Transcript"} + {response?.items.map((item: GetTranscript) => ( + + + + {item.title || item.name || "Unamed Transcript"} - {item.status == "ended" && ( - - )} - {item.status == "error" && ( - - )} - {item.status == "idle" && ( - - )} - {item.status == "processing" && ( - - )} - {item.status == "recording" && ( - - )} - - - - {new Date(item.created_at).toLocaleString("en-US")} - {"\u00A0"}-{"\u00A0"} - {formatTime(Math.floor(item.duration / 1000))} - - {item.short_summary} - - + {item.status == "ended" && ( + + )} + {item.status == "error" && ( + + )} + {item.status == "idle" && ( + + )} + {item.status == "processing" && ( + + )} + {item.status == "recording" && ( + + )} + + + + {new Date(item.created_at).toLocaleString("en-US")} + {"\u00A0"}-{"\u00A0"} + {formatTime(Math.floor(item.duration / 1000))} + + {item.short_summary} + + - {item.status !== "ended" && ( - <> - - - - - - - - - - - Are you sure you want to delete {item.title} ? - - - This action is not reversible. - - - - - - - - - )} - - ))} + + + + + + )} + + ))} ); diff --git a/www/app/[domain]/browse/pagination.tsx b/www/app/[domain]/browse/pagination.tsx index 721d1747..7c67a60b 100644 --- a/www/app/[domain]/browse/pagination.tsx +++ b/www/app/[domain]/browse/pagination.tsx @@ -1,5 +1,5 @@ -import { faArrowLeft, faArrowRight } from "@fortawesome/free-solid-svg-icons"; -import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; +import { Button, Flex, IconButton } from "@chakra-ui/react"; +import { FaChevronLeft, FaChevronRight } from "react-icons/fa"; type PaginationProps = { page: number; @@ -39,40 +39,41 @@ export default function Pagination(props: PaginationProps) { setPage(newPage); } }; - return ( -
- + aria-label="Previous page" + /> {pageNumbers.map((pageNumber) => ( - + ))} - -
+ aria-label="Next page" + /> + ); } diff --git a/www/app/providers.tsx b/www/app/providers.tsx index 5197ff15..e1c4f283 100644 --- a/www/app/providers.tsx +++ b/www/app/providers.tsx @@ -1,7 +1,8 @@ "use client"; import { ChakraProvider } from "@chakra-ui/react"; +import theme from "./theme"; export function Providers({ children }: { children: React.ReactNode }) { - return {children}; + return {children}; } diff --git a/www/app/theme.ts b/www/app/theme.ts new file mode 100644 index 00000000..e951eef0 --- /dev/null +++ b/www/app/theme.ts @@ -0,0 +1,34 @@ +// 1. Import `extendTheme` +import { extendTheme } from "@chakra-ui/react"; + +// 2. Call `extendTheme` and pass your custom values +const theme = extendTheme({ + colors: { + blue: { + primary: "#3158E2", + 500: "#3158E2", + light: "#B1CBFF", + 200: "#B1CBFF", + dark: "#0E1B48", + 900: "#0E1B48", + }, + red: { + primary: "#DF7070", + 500: "#DF7070", + light: "#FBD5D5", + 200: "#FBD5D5", + }, + gray: { + bg: "#F4F4F4", + 100: "#F4F4F4", + light: "#D5D5D5", + 200: "#D5D5D5", + primary: "#838383", + 500: "#838383", + }, + light: "#FFFFFF", + dark: "#0C0D0E", + }, +}); + +export default theme;