feat(credits): solde IA unique (option M), packs Stripe et polish billing
Un pot de crédits global (BASIC 100 / PRO 1 000 / BUSINESS 4 000) remplace les seaux par fonction côté débit. Packs one-shot S/M/L, admin sans seaux legacy, usage multi-features, hints de coût, anti-flash thème et hydratation admin. Inclut aussi le pipeline slides renforcé et la page publique polishée.
This commit is contained in:
42
memento-note/components/publish/copy-link-button.tsx
Normal file
42
memento-note/components/publish/copy-link-button.tsx
Normal file
@@ -0,0 +1,42 @@
|
||||
'use client'
|
||||
|
||||
import { useState, type CSSProperties } from 'react'
|
||||
import { Check, Link2 } from 'lucide-react'
|
||||
|
||||
export function CopyLinkButton({
|
||||
label = 'Copier le lien',
|
||||
copiedLabel = 'Copié',
|
||||
className,
|
||||
style,
|
||||
}: {
|
||||
label?: string
|
||||
copiedLabel?: string
|
||||
className?: string
|
||||
style?: CSSProperties
|
||||
}) {
|
||||
const [copied, setCopied] = useState(false)
|
||||
|
||||
const onCopy = async () => {
|
||||
try {
|
||||
await navigator.clipboard.writeText(window.location.href)
|
||||
setCopied(true)
|
||||
window.setTimeout(() => setCopied(false), 2000)
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
<button
|
||||
type="button"
|
||||
onClick={() => void onCopy()}
|
||||
className={className}
|
||||
style={style}
|
||||
aria-label={copied ? copiedLabel : label}
|
||||
title={copied ? copiedLabel : label}
|
||||
>
|
||||
{copied ? <Check size={13} strokeWidth={2.25} /> : <Link2 size={13} strokeWidth={2.25} />}
|
||||
<span>{copied ? copiedLabel : label}</span>
|
||||
</button>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user