diff --git a/src/pages/sessions/session-list.tsx b/src/pages/sessions/session-list.tsx new file mode 100644 index 0000000..b40d7fc --- /dev/null +++ b/src/pages/sessions/session-list.tsx @@ -0,0 +1,62 @@ +import formatDistanceToNow from "date-fns/formatDistanceToNow" +import {ScrollArea} from "@/components/ui/scroll-area.tsx"; +import useAppStore from "@/store/useAppStore.ts"; +import {Session} from "@/types/Session.ts"; +import {cn} from "@/lib/utils.ts"; + +interface MailListProps { + items: Session[] +} + +export function SessionList({items}: MailListProps) { + const [editingSession, setEditingSession] = useAppStore(state => [state.editingSession, state.setEditingSession]); + + const getFormatedDate = (date_str: string) => { + console.log(date_str) + try { + // @ts-ignore + return formatDistanceToNow(new Date(date_str), {addSuffix: true,}) + } catch (error) { + return date_str + } + } + + return ( + +
+ {items && items.map((item) => ( + + ))} +
+
+ ) +} \ No newline at end of file