import { useState } from 'react' import { Brush, Combine, Download, Eraser, Grid3x3, LoaderCircle, PenTool, RotateCcw, Save, ScanSearch, Sparkles, Split, Trash2, X, } from 'lucide-react' import { useStore } from '@/store' import type { Effect, Search } from '@/types' import { Button } from '@/components/ui/button' import { Field, Input, Section, Select, SliderField, SwitchField, Textarea, Tooltip } from '@/components/ui/controls' import { fontFamilyOf } from '@/fonts' import { cn } from '@/lib/utils' const fixed = (digits: number) => (value: number) => value.toFixed(digits) const percent = (value: number) => `${Math.round(value * 100)}%` const OFF = 'Off' const EFFECTS: { value: Effect; label: string }[] = [ { value: 'none', label: 'Paint' }, { value: 'embroidery', label: 'Embroidery' }, { value: 'stencil', label: 'Worn stencil' }, { value: 'neon', label: 'Neon' }, { value: 'engraving', label: 'Engraving' }, ] /** A color swatch with its hex code, as the Letters section shows it. */ function ColorField({ label, value, onChange, disabled, }: { label: string value: string onChange: (value: string) => void disabled?: boolean }) { return ( ) } function Lines() { const items = useStore((state) => state.items) const active = useStore((state) => state.active) const setActive = useStore((state) => state.setActive) const setText = useStore((state) => state.setText) const setErase = useStore((state) => state.setErase) const removeItem = useStore((state) => state.removeItem) const clearItems = useStore((state) => state.clearItems) const resetShape = useStore((state) => state.resetShape) const clearStrokes = useStore((state) => state.clearStrokes) const joinItems = useStore((state) => state.joinItems) const splitItem = useStore((state) => state.splitItem) const clearPath = useStore((state) => state.clearPath) const clearWarp = useStore((state) => state.clearWarp) const look = useStore((state) => state.look) return (
0 && (
{items.length > 1 && ( )}
) } > {items.length === 0 ? (

Click the text to replace on the image. Each line you pick gets a number here and a field for its new text.

) : (
    {items.map((item, index) => { const isActive = item.key === active const lines = Math.min(6, Math.max(1, item.text.split('\n').length)) return (
  1. setActive(item.key)} className={cn( 'rounded-md border border-transparent p-1.5 transition-colors', isActive && 'border-chosen/50 bg-chosen/5', )} >
    {index + 1}