diff --git a/frontend/public/contract.png b/frontend/public/contract.png new file mode 100644 index 0000000..ee20c06 Binary files /dev/null and b/frontend/public/contract.png differ diff --git a/frontend/src/_mocks/data-form-library.ts b/frontend/src/_mocks/data-form-library.ts index 458c8fd..2e0b4fe 100644 --- a/frontend/src/_mocks/data-form-library.ts +++ b/frontend/src/_mocks/data-form-library.ts @@ -6,26 +6,29 @@ type Template = { usageCount: number isNew: boolean isVip: boolean + thumbnail?: string } export const mockTemplates: Template[] = [ { id: '1', - title: 'Biểu mẫu hợp đồng', - description: 'Tìm và chọn mẫu hợp đồng pháp lý để bắt đầu soạn thảo.', + title: 'Hợp đồng thỏa thuận', + description: 'Hợp đồng thoả thuận giá trị được hiểu là thống nhất ý chí trên cơ sở tự nguyện về việc xác nhận .', category: 'Hợp đồng', usageCount: 1200, isNew: true, - isVip: true + isVip: true, + thumbnail: '/contract.png' }, { id: '2', - title: 'Biểu mẫu hợp đồng', + title: 'Hợp đồng thỏa thuận', description: 'Tìm và chọn mẫu hợp đồng pháp lý để bắt đầu soạn thảo.', category: 'Hợp đồng', usageCount: 1200, isNew: false, - isVip: false + isVip: false, + thumbnail: '/contract.png' }, { id: '3', @@ -34,7 +37,8 @@ export const mockTemplates: Template[] = [ category: 'Hợp đồng', usageCount: 1200, isNew: true, - isVip: true + isVip: true, + thumbnail: '/contract.png' }, { id: '4', @@ -43,7 +47,8 @@ export const mockTemplates: Template[] = [ category: 'Hợp đồng', usageCount: 1200, isNew: false, - isVip: true + isVip: true, + thumbnail: '/contract.png' }, { id: '5', @@ -52,7 +57,8 @@ export const mockTemplates: Template[] = [ category: 'Hợp đồng', usageCount: 950, isNew: true, - isVip: false + isVip: false, + thumbnail: '/contract.png' }, { id: '6', @@ -61,7 +67,8 @@ export const mockTemplates: Template[] = [ category: 'Hợp đồng', usageCount: 1100, isNew: false, - isVip: false + isVip: false, + thumbnail: '/contract.png' }, { id: '7', @@ -70,7 +77,8 @@ export const mockTemplates: Template[] = [ category: 'Hợp đồng', usageCount: 850, isNew: false, - isVip: true + isVip: true, + thumbnail: '/contract.png' }, { id: '8', @@ -79,6 +87,7 @@ export const mockTemplates: Template[] = [ category: 'Hợp đồng', usageCount: 1350, isNew: true, - isVip: true + isVip: true, + thumbnail: '/contract.png' } ] diff --git a/frontend/src/components/ui/FormCard.tsx b/frontend/src/components/ui/FormCard.tsx index 3fde6c4..aa5b4e5 100644 --- a/frontend/src/components/ui/FormCard.tsx +++ b/frontend/src/components/ui/FormCard.tsx @@ -1,7 +1,19 @@ import { motion } from 'framer-motion' import { FileText } from 'lucide-react' -import { Badge, Button, Card, CardContent, CardFooter } from '@/components/ui' +import { + Badge, + Button, + Card, + CardContent, + CardFooter, + Dialog, + DialogContent, + DialogHeader, + DialogTitle, + DialogTrigger, + DialogClose +} from '@/components/ui' import { cn } from '@/core/lib/utils' import { type Template, type ViewMode } from '@/models/types/form-library' @@ -25,7 +37,7 @@ export default function FormCard({ template, viewMode, index }: FormCardProps) { } const cardClasses = cn( - 'h-full border border-border-primary bg-background-primary transition-all duration-300 hover:shadow-lg hover:scale-[1.02]', + 'h-full border border-border-primary bg-background-primary shadow-200 transition-all duration-300 hover:shadow-300 hover:scale-105', viewMode === 'list' && 'flex flex-col gap-4' ) @@ -50,16 +62,16 @@ export default function FormCard({ template, viewMode, index }: FormCardProps) {
-

{template.title}

-

{template.description}

+

{template.title}

+

{template.description}

- + {template.category} -
+
{template.usageCount.toLocaleString('vi-VN')} người dùng
@@ -67,10 +79,67 @@ export default function FormCard({ template, viewMode, index }: FormCardProps) {
- - + + + + + + +
+
+ {template.thumbnail ? ( + {template.title} + ) : ( +
+ Ảnh xem trước biểu mẫu +
+ )} +
+ +
+ + {template.title} + + +
+
+
+ Mô tả +
+

{template.description}

+
+ +
+
+ Phân loại + {template.category} +
+
+ Số lượt sử dụng + + {template.usageCount.toLocaleString('vi-VN')} + +
+
+
+ +
+ + + + +
+
+
+
+
+ diff --git a/frontend/src/pages/users/template/Template.tsx b/frontend/src/pages/users/template/Template.tsx index 3c7ad0a..365b2f3 100644 --- a/frontend/src/pages/users/template/Template.tsx +++ b/frontend/src/pages/users/template/Template.tsx @@ -35,8 +35,8 @@ export default function Template() { {/* Header */}
-

Thư viện biểu mẫu

-

+

Thư viện biểu mẫu

+

Khám phá hàng trăm biểu mẫu pháp lý được tạo bởi các chuyên gia

@@ -45,19 +45,12 @@ export default function Template() {
{/* Search Bar */}
- + setSearchQuery(e.target.value)} - className={cn( - 'pl-10 w-full', - 'border-slate-200 dark:border-slate-700', - 'placeholder:text-slate-400 dark:placeholder:text-slate-500' - )} + className={cn('pl-10 w-full', 'border-border-primary', 'placeholder:text-text-tertiary')} />
@@ -66,9 +59,8 @@ export default function Template() {
{/* Results count */} -
- Tìm thấy {filteredTemplates.length} biểu - mẫu +
+ Tìm thấy {filteredTemplates.length} biểu mẫu