refactor: quality workflow, docs, tests
This commit is contained in:
parent
a9caf36b01
commit
68ace0a858
27 changed files with 758 additions and 330 deletions
|
|
@ -307,7 +307,7 @@ export function TicketSummaryHeader({ ticket }: TicketHeaderProps) {
|
|||
})
|
||||
setQueueSelection(ticket.queue ?? "")
|
||||
setAssigneeSelection(ticket.assignee?.id ?? "")
|
||||
}, [editing, ticket.category?.id, ticket.subcategory?.id, ticket.queue])
|
||||
}, [editing, ticket.category?.id, ticket.subcategory?.id, ticket.queue, ticket.assignee?.id])
|
||||
|
||||
useEffect(() => {
|
||||
if (!editing) return
|
||||
|
|
|
|||
49
src/components/ui/copy-button.tsx
Normal file
49
src/components/ui/copy-button.tsx
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
"use client"
|
||||
|
||||
import { useCallback, useState } from "react"
|
||||
import { Copy, Sparkles } from "lucide-react"
|
||||
|
||||
import { Button } from "@/components/ui/button"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
interface CopyButtonProps {
|
||||
value: string
|
||||
onCopied?: () => void
|
||||
}
|
||||
|
||||
export function CopyButton({ value, onCopied }: CopyButtonProps) {
|
||||
const [copied, setCopied] = useState(false)
|
||||
|
||||
const handleCopy = useCallback(async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(value)
|
||||
setCopied(true)
|
||||
onCopied?.()
|
||||
setTimeout(() => setCopied(false), 2000)
|
||||
} catch (error) {
|
||||
console.error("Falha ao copiar código", error)
|
||||
}
|
||||
}, [onCopied, value])
|
||||
|
||||
return (
|
||||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
size="sm"
|
||||
onClick={handleCopy}
|
||||
className="relative overflow-hidden border border-dashed border-slate-300 bg-white px-3 py-2 text-sm font-semibold text-neutral-700 transition-all hover:border-slate-400 hover:bg-white active:scale-[0.97]"
|
||||
>
|
||||
<span className="pointer-events-none absolute inset-0 rounded-md bg-neutral-900/5 opacity-0 transition-opacity duration-100 ease-out active:opacity-100" />
|
||||
<span
|
||||
className={cn(
|
||||
"flex items-center gap-2 transition-all duration-200 ease-out",
|
||||
copied ? "text-emerald-600" : "text-neutral-700"
|
||||
)}
|
||||
>
|
||||
{copied ? <Sparkles className="size-3.5" /> : <Copy className="size-3.5" />}
|
||||
{copied ? "Copiado!" : "Copiar código"}
|
||||
</span>
|
||||
<span className="sr-only">Copiar código de provisionamento</span>
|
||||
</Button>
|
||||
)
|
||||
}
|
||||
21
src/components/ui/crossblur.tsx
Normal file
21
src/components/ui/crossblur.tsx
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
"use client"
|
||||
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
export function Crossblur({ active }: { active: boolean }) {
|
||||
return (
|
||||
<span
|
||||
className={cn(
|
||||
"pointer-events-none absolute inset-0 overflow-hidden rounded-xl transition-opacity duration-200 ease-out",
|
||||
active ? "opacity-100" : "opacity-0"
|
||||
)}
|
||||
>
|
||||
<span
|
||||
className={cn(
|
||||
"absolute inset-[-40%] rounded-full bg-[radial-gradient(circle_at_center,_rgba(59,130,246,0.25),_transparent_70%)] blur-lg transition-transform duration-500 ease-in-out",
|
||||
active ? "scale-[1.05] rotate-6" : "scale-100 -rotate-12"
|
||||
)}
|
||||
/>
|
||||
</span>
|
||||
)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue