@dilipod/ui 0.4.34 → 0.4.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dilipod/ui",
3
- "version": "0.4.34",
3
+ "version": "0.4.35",
4
4
  "description": "Dilipod Design System - Shared UI components and styles",
5
5
  "author": "Dilipod <hello@dilipod.com>",
6
6
  "license": "MIT",
@@ -22,6 +22,7 @@ export interface UploadedFile {
22
22
  type: string
23
23
  size: number
24
24
  url?: string
25
+ processing?: boolean
25
26
  }
26
27
 
27
28
  export interface FilePreviewProps {
@@ -157,11 +158,12 @@ export function FilePreview({
157
158
  const FileIcon = getFileIcon(file.type)
158
159
  const typeLabel = getTypeLabel(file.type)
159
160
  const sizeLabel = formatSize(file.size)
160
- const isPreviewable = canPreview(file)
161
+ const isProcessing = file.processing === true
162
+ const isPreviewable = !isProcessing && canPreview(file)
161
163
  const previewType = getPreviewType(file)
162
-
164
+
163
165
  return (
164
- <div
166
+ <div
165
167
  key={i}
166
168
  className={`flex items-center justify-between p-3 rounded-md bg-gray-50 transition-colors ${
167
169
  isPreviewable ? 'hover:bg-gray-100 cursor-pointer' : ''
@@ -171,29 +173,41 @@ export function FilePreview({
171
173
  <div className="flex items-center gap-3 min-w-0">
172
174
  <div className="relative shrink-0">
173
175
  <div className="w-10 h-10 rounded-sm bg-white border border-gray-200 flex items-center justify-center">
174
- <FileIcon className="w-5 h-5 text-[var(--cyan)]" weight="fill" />
176
+ {isProcessing ? (
177
+ <CircleNotch className="w-5 h-5 text-[var(--cyan)] animate-spin" />
178
+ ) : (
179
+ <FileIcon className="w-5 h-5 text-[var(--cyan)]" weight="fill" />
180
+ )}
175
181
  </div>
176
- {previewType === 'video' && (
182
+ {!isProcessing && previewType === 'video' && (
177
183
  <Play className="absolute -bottom-0.5 -right-0.5 w-3.5 h-3.5 text-[var(--cyan)] bg-white rounded-full" weight="fill" />
178
184
  )}
179
185
  </div>
180
186
  <div className="min-w-0">
181
187
  <p className="text-sm font-medium text-[var(--black)] truncate">{file.filename}</p>
182
188
  <p className="text-xs text-muted-foreground">
183
- {typeLabel} · {sizeLabel}
184
- {isPreviewable && (
185
- <span className="text-[var(--cyan)] ml-1">· Click to preview</span>
189
+ {isProcessing ? (
190
+ <span className="text-amber-600">Processing video — this takes about a minute</span>
191
+ ) : (
192
+ <>
193
+ {typeLabel} · {sizeLabel}
194
+ {isPreviewable && (
195
+ <span className="text-[var(--cyan)] ml-1">· Click to preview</span>
196
+ )}
197
+ </>
186
198
  )}
187
199
  </p>
188
200
  </div>
189
201
  </div>
190
- <button
191
- onClick={(e) => handleDownload(e, file)}
192
- className="p-2 rounded-sm hover:bg-gray-200 transition-colors shrink-0"
193
- title="Download"
194
- >
195
- <Download className="w-4 h-4 text-muted-foreground" />
196
- </button>
202
+ {!isProcessing && (
203
+ <button
204
+ onClick={(e) => handleDownload(e, file)}
205
+ className="p-2 rounded-sm hover:bg-gray-200 transition-colors shrink-0"
206
+ title="Download"
207
+ >
208
+ <Download className="w-4 h-4 text-muted-foreground" />
209
+ </button>
210
+ )}
197
211
  </div>
198
212
  )
199
213
  })}