MCPcopy Create free account
hub / github.com/dailydotdev/apps / CopyStateIcon

Function CopyStateIcon

packages/shared/src/components/share/CopyStateIcon.tsx:19–52  ·  view source on GitHub ↗
({
  copied,
  icon: Icon = CopyIcon,
  className,
  ...props
}: IconProps & {
  copied: boolean;
  /** What the button rests on — a link glyph where the payload is a URL. */
  icon?: ComponentType<IconProps>;
})

Source from the content-addressed store, hash-verified

17 * the transition collapses to an instant swap under `prefers-reduced-motion`.
18 */
19export const CopyStateIcon = ({
20 copied,
21 icon: Icon = CopyIcon,
22 className,
23 ...props
24}: IconProps & {
25 copied: boolean;
26 /** What the button rests on — a link glyph where the payload is a URL. */
27 icon?: ComponentType<IconProps>;
28}): ReactElement => {
29 const layer = classNames(
30 className,
31 'col-start-1 row-start-1 transition-[opacity,transform,filter] duration-200 motion-reduce:transition-none',
32 EASE_OUT_EXPO,
33 );
34
35 return (
36 <span className="inline-grid">
37 <Icon
38 {...props}
39 className={classNames(layer, copied && 'scale-50 opacity-0 blur-[2px]')}
40 />
41 <VIcon
42 {...props}
43 secondary
44 className={classNames(
45 layer,
46 'text-status-success',
47 !copied && 'scale-50 opacity-0 blur-[2px]',
48 )}
49 />
50 </span>
51 );
52};

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected