feat(chats): add delete functionality

This commit is contained in:
ItzCrazyKns 2024-07-02 10:51:47 +05:30
parent 6ae825999a
commit c74e16e01c
No known key found for this signature in database
GPG key ID: 8162927C7CCE3065
3 changed files with 145 additions and 2 deletions

View file

@ -1,11 +1,12 @@
'use client';
import DeleteChat from '@/components/DeleteChat';
import { formatTimeDifference } from '@/lib/utils';
import { BookOpenText, ClockIcon, ScanEye } from 'lucide-react';
import { BookOpenText, ClockIcon, Delete, ScanEye } from 'lucide-react';
import Link from 'next/link';
import { useEffect, useState } from 'react';
interface Chat {
export interface Chat {
id: string;
title: string;
createdAt: string;
@ -92,6 +93,11 @@ const Page = () => {
{formatTimeDifference(new Date(), chat.createdAt)} Ago
</p>
</div>
<DeleteChat
chatId={chat.id}
chats={chats}
setChats={setChats}
/>
</div>
</div>
))}