|
4 | 4 | CheckIcon, |
5 | 5 | DownloadIcon, |
6 | 6 | FileCodeIcon, |
7 | | - TableIcon, |
8 | 7 | FileTextIcon, |
| 8 | + TableIcon, |
9 | 9 | } from "@phosphor-icons/react"; |
10 | 10 | import dayjs from "dayjs"; |
11 | 11 | import { useParams } from "next/navigation"; |
@@ -124,35 +124,38 @@ export default function ExportPage() { |
124 | 124 | <Label className="font-medium text-sm">Export format</Label> |
125 | 125 | </div> |
126 | 126 | <div className="grid grid-cols-1 gap-3 sm:grid-cols-3"> |
127 | | - {formatOptions.map((format) => ( |
128 | | - <button |
129 | | - className={`flex items-start gap-3 rounded-md border p-4 text-left transition-colors hover:border-primary/50 ${ |
130 | | - selectedFormat === format.value |
131 | | - ? "border-primary bg-primary/5" |
132 | | - : "border-border" |
133 | | - }`} |
134 | | - key={format.value} |
135 | | - onClick={() => setSelectedFormat(format.value)} |
136 | | - type="button" |
137 | | - > |
138 | | - <div className="flex h-8 w-8 items-center justify-center rounded-md bg-muted"> |
139 | | - <format.icon className="h-5 w-5" /> |
140 | | - </div> |
141 | | - <div className="min-w-0 flex-1"> |
142 | | - <div className="mb-1 flex items-center gap-2"> |
143 | | - <span className="font-medium text-sm"> |
144 | | - {format.label} |
145 | | - </span> |
146 | | - {selectedFormat === format.value && ( |
147 | | - <CheckIcon className="h-4 w-4 text-primary" /> |
148 | | - )} |
| 127 | + {formatOptions.map((format) => { |
| 128 | + const IconComponent = format.icon; |
| 129 | + return ( |
| 130 | + <button |
| 131 | + className={`flex items-start gap-3 rounded-md border p-4 text-left transition-colors hover:border-primary/50 ${ |
| 132 | + selectedFormat === format.value |
| 133 | + ? "border-primary bg-primary/5" |
| 134 | + : "border-border" |
| 135 | + }`} |
| 136 | + key={format.value} |
| 137 | + onClick={() => setSelectedFormat(format.value)} |
| 138 | + type="button" |
| 139 | + > |
| 140 | + <div className="flex h-8 w-8 items-center justify-center rounded-md bg-muted"> |
| 141 | + <IconComponent className="h-5 w-5" /> |
| 142 | + </div> |
| 143 | + <div className="min-w-0 flex-1"> |
| 144 | + <div className="mb-1 flex items-center gap-2"> |
| 145 | + <span className="font-medium text-sm"> |
| 146 | + {format.label} |
| 147 | + </span> |
| 148 | + {selectedFormat === format.value && ( |
| 149 | + <CheckIcon className="h-4 w-4 text-primary" /> |
| 150 | + )} |
| 151 | + </div> |
| 152 | + <p className="text-muted-foreground text-xs"> |
| 153 | + {format.description} |
| 154 | + </p> |
149 | 155 | </div> |
150 | | - <p className="text-muted-foreground text-xs"> |
151 | | - {format.description} |
152 | | - </p> |
153 | | - </div> |
154 | | - </button> |
155 | | - ))} |
| 156 | + </button> |
| 157 | + ); |
| 158 | + })} |
156 | 159 | </div> |
157 | 160 | </section> |
158 | 161 |
|
|
0 commit comments