|
1 | 1 | 'use client'; |
2 | 2 |
|
3 | 3 | import { useEffect, useState } from 'react'; |
4 | | -import { useParams } from 'next/navigation'; |
| 4 | +import { useParams, useRouter } from 'next/navigation'; |
5 | 5 | import Header from '@/components/Header'; |
6 | 6 | import Footer from '@/components/Footer'; |
7 | 7 | import NoImage from '@/components/NoImage'; |
| 8 | +import Link from 'next/link'; |
8 | 9 |
|
9 | 10 | export default function DrugDetailPage() { |
10 | 11 | const params = useParams(); |
@@ -111,7 +112,7 @@ export default function DrugDetailPage() { |
111 | 112 | </div> |
112 | 113 | <div className="flex items-center"> |
113 | 114 | <span className="w-24 text-sm font-medium text-gray-500">의약품 구분</span> |
114 | | - <span className="text-gray-700">{getEtcOtcName(drug.isGeneral)} / {drug.isHerbal ? '한약' : '양약'}</span> |
| 115 | + <span className="text-gray-700">{getEtcOtcName(drug.isGeneral)}</span> |
115 | 116 | </div> |
116 | 117 | </div> |
117 | 118 | <div className="space-y-2"> |
@@ -157,17 +158,22 @@ export default function DrugDetailPage() { |
157 | 158 | <th className="px-4 py-2 bg-gray-50 text-left text-sm font-medium text-gray-500">분량</th> |
158 | 159 | <th className="px-4 py-2 bg-gray-50 text-left text-sm font-medium text-gray-500">단위</th> |
159 | 160 | <th className="px-4 py-2 bg-gray-50 text-left text-sm font-medium text-gray-500">총량</th> |
160 | | - <th className="px-4 py-2 bg-gray-50 text-left text-sm font-medium text-gray-500">규격</th> |
161 | 161 | </tr> |
162 | 162 | </thead> |
163 | 163 | <tbody className="bg-white divide-y divide-gray-200"> |
164 | 164 | {drug.materialInfo.map((material, index) => ( |
165 | 165 | <tr key={index}> |
166 | | - <td className="px-4 py-2 whitespace-nowrap text-sm text-gray-700">{material.성분명}</td> |
| 166 | + <td className="px-4 py-2 whitespace-nowrap text-sm text-gray-700"> |
| 167 | + <Link |
| 168 | + href={`/search/material?q=${encodeURIComponent(material.성분명)}&mode=keyword&type=material`} |
| 169 | + className="text-blue-600 hover:text-blue-800 hover:underline" |
| 170 | + > |
| 171 | + {material.성분명} |
| 172 | + </Link> |
| 173 | + </td> |
167 | 174 | <td className="px-4 py-2 whitespace-nowrap text-sm text-gray-700">{material.분량}</td> |
168 | 175 | <td className="px-4 py-2 whitespace-nowrap text-sm text-gray-700">{material.단위}</td> |
169 | 176 | <td className="px-4 py-2 whitespace-nowrap text-sm text-gray-700">{material.총량}</td> |
170 | | - <td className="px-4 py-2 whitespace-nowrap text-sm text-gray-700">{material.규격}</td> |
171 | 177 | </tr> |
172 | 178 | ))} |
173 | 179 | </tbody> |
|
0 commit comments