refactor: centralize action/icon button styles across all tools
Extract shared actionBtn and iconBtn constants into lib/utils/styles.ts and replace all 11 local definitions across tool components. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -17,13 +17,10 @@ import { addToHistory } from '@/lib/media/storage/history';
|
||||
import { downloadBlobsAsZip, generateOutputFilename } from '@/lib/media/utils/fileUtils';
|
||||
import type { ConversionJob, ConversionFormat, ConversionOptions } from '@/types/media';
|
||||
import { ShieldCheck, Download, RotateCcw, Loader2 } from 'lucide-react';
|
||||
import { cn } from '@/lib/utils';
|
||||
import { cn, actionBtn } from '@/lib/utils';
|
||||
|
||||
type MobileTab = 'upload' | 'convert';
|
||||
|
||||
const actionBtn =
|
||||
'flex items-center justify-center gap-1.5 px-3 py-1.5 text-xs glass rounded-md border border-border/30 text-muted-foreground hover:text-primary hover:border-primary/30 hover:bg-primary/10 transition-all disabled:opacity-40 disabled:cursor-not-allowed';
|
||||
|
||||
const selectCls =
|
||||
'w-full bg-transparent border border-border/40 rounded-lg px-2.5 py-1.5 text-xs font-mono outline-none focus:border-primary/50 transition-colors text-foreground/80 cursor-pointer disabled:opacity-40';
|
||||
|
||||
@@ -439,7 +436,7 @@ export function FileConverter() {
|
||||
<button
|
||||
onClick={handleConvert}
|
||||
disabled={!selectedFiles.length || !outputFormat || isConverting}
|
||||
className={cn(actionBtn, 'flex-1 py-2')}
|
||||
className={cn(actionBtn, 'flex-1 justify-center py-2')}
|
||||
>
|
||||
{isConverting
|
||||
? <><Loader2 className="w-3 h-3 animate-spin" />Converting…</>
|
||||
|
||||
Reference in New Issue
Block a user