WFDASH-WEBAPP/src/components/ui/tooltip.tsx
SJCoetz 588e9762c2 feat: add quote templates, improved email, new statuses
Add complete quote template functionality, enhanced outbound email sending, new quote statuses, and supporting infrastructure:
- Add new quote statuses (template, sending, mail_failed) with tailored UI styling for status pills
- Implement full template workflows: save real quotes as templates, create new quotes from existing templates
- Add support for custom quote dates and extended validity periods on generated PDF documents
- Build out improved email pipeline with persisted compose fields and retry functionality for failed sends
- Add attachment direction tracking to categorize inbound, outbound, and generated quote attachments
- Fix tooltip component to properly handle Radix `asChild` prop to avoid React DOM attribute errors
- Add comprehensive test coverage, schema migrations, and update sample test and production data
2026-06-24 22:57:01 +02:00

52 lines
1.4 KiB
TypeScript

"use client"
import * as React from "react"
import { cn } from "@/lib/utils"
type TooltipProviderProps = { children: React.ReactNode; delay?: number }
function TooltipProvider({ children }: TooltipProviderProps) {
return <>{children}</>
}
type TooltipProps = { children: React.ReactNode }
function Tooltip({ children }: TooltipProps) {
return <>{children}</>
}
type TooltipTriggerProps = React.HTMLAttributes<HTMLElement> & {
asChild?: boolean
children: React.ReactElement<Record<string, unknown>>
}
function TooltipTrigger({ children, asChild: _asChild, ...props }: TooltipTriggerProps) {
// `asChild` is a Radix-isms hint meaning "merge into the child". This
// shim implements that via React.cloneElement, so we destructure
// `asChild` out before spreading — otherwise it leaks to the DOM as
// an unknown attribute (e.g. `<button asChild>`) and React logs a
// noisy console error.
void _asChild;
return React.cloneElement(children, {
...props,
...children.props,
})
}
type TooltipContentProps = React.HTMLAttributes<HTMLSpanElement> & {
children: React.ReactNode
}
function TooltipContent({ className, children, ...props }: TooltipContentProps) {
return (
<span
role="tooltip"
className={cn("sr-only", className)}
{...props}
>
{children}
</span>
)
}
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider }