File size: 3,235 Bytes
a56d13e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
const PrintableContent = () => (
  <div className="rounded-lg border border-gray-200 bg-white p-6 shadow-sm">
    <div className="mb-8 text-center">
      <h2 className="text-3xl font-bold text-gray-900">Printable Document</h2>
      <p className="mt-2 text-gray-600">This content is designed to be printed</p>
    </div>

    <div className="mb-8">
      <h3 className="text-xl font-semibold text-gray-800">Document Details</h3>
      <div className="mt-4 grid grid-cols-1 gap-4 sm:grid-cols-2">
        <div className="rounded-lg bg-gray-50 p-4">
          <p className="text-sm font-medium text-gray-500">Title</p>
          <p className="text-lg font-semibold text-gray-900">React Print Modal Demo</p>
        </div>
        <div className="rounded-lg bg-gray-50 p-4">
          <p className="text-sm font-medium text-gray-500">Date</p>
          <p className="text-lg font-semibold text-gray-900">October 25, 2023</p>
        </div>
        <div className="rounded-lg bg-gray-50 p-4">
          <p className="text-sm font-medium text-gray-500">Author</p>
          <p className="text-lg font-semibold text-gray-900">React Developer</p>
        </div>
        <div className="rounded-lg bg-gray-50 p-4">
          <p className="text-sm font-medium text-gray-500">Status</p>
          <p className="text-lg font-semibold text-secondary">Completed</p>
        </div>
      </div>
    </div>

    <div className="mb-8">
      <h3 className="text-xl font-semibold text-gray-800">Main Content</h3>
      <div className="mt-4 space-y-4 text-gray-700">
        <p>
          This is a sample document designed to demonstrate how to print modal content in React.
          The content inside this modal can be easily printed using the print button, which opens
          a new window with just the content you want to print.
        </p>
        <p>
          The application uses Tailwind CSS for styling and includes a custom print modal component
          that provides a clean interface for printing specific content. This approach ensures that
          only the relevant content is printed without any UI elements or navigation.
        </p>
        <div className="rounded-lg bg-blue-50 p-4">
          <h4 className="font-semibold text-blue-900">Key Features</h4>
          <ul className="mt-2 list-disc space-y-1 pl-5 text-blue-800">
            <li>Clean print preview modal</li>
            <li>Custom print functionality</li>
            <li>Tailwind CSS styling</li>
            <li>Responsive design</li>
          </ul>
        </div>
      </div>
    </div>

    <div className="border-t border-gray-200 pt-6">
      <div className="flex flex-col items-center justify-center space-y-4 sm:flex-row sm:justify-between">
        <div className="text-center sm:text-left">
          <p className="text-sm text-gray-500">For more information</p>
          <p className="text-lg font-semibold text-gray-900">Visit our website</p>
        </div>
        <div className="flex space-x-2">
          <div className="h-12 w-12 rounded bg-gray-200"></div>
          <div className="h-12 w-12 rounded bg-gray-200"></div>
          <div className="h-12 w-12 rounded bg-gray-200"></div>
        </div>
      </div>
    </div>
  </div>
);