mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-06-05 20:15:31 -04:00
minor style tweaks
This commit is contained in:
@@ -5,12 +5,18 @@ import copy from "copy-to-clipboard";
|
||||
import { ClipboardIcon, CheckIcon } from "lucide-react";
|
||||
import type { Ref, ComponentPropsWithoutRef, ComponentRef, MouseEventHandler } from "react";
|
||||
|
||||
export type CopyButtonProps = ComponentPropsWithoutRef<"button"> & {
|
||||
source: string;
|
||||
timeout?: number;
|
||||
};
|
||||
|
||||
const CopyButton = ({ source, timeout = 2000, style, ...rest }: CopyButtonProps, ref: Ref<ComponentRef<"button">>) => {
|
||||
const CopyButton = (
|
||||
{
|
||||
source,
|
||||
timeout = 2000,
|
||||
style,
|
||||
...rest
|
||||
}: ComponentPropsWithoutRef<"button"> & {
|
||||
source: string;
|
||||
timeout?: number;
|
||||
},
|
||||
ref: Ref<ComponentRef<"button">>
|
||||
) => {
|
||||
const [copied, setCopied] = useState(false);
|
||||
|
||||
const handleCopy: MouseEventHandler<ComponentRef<"button">> = (e) => {
|
||||
|
||||
Reference in New Issue
Block a user