File size: 443 Bytes
f0743f4 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | export const BlinkAnimation = ({
active,
children,
}: {
active: boolean;
children: React.ReactNode;
}) => {
const style = `
@keyframes blink-animation {
0%,
100% {
opacity: 1;
}
50% {
opacity: 0;
}
}`;
if (!active) {
return <>{children}</>;
}
return (
<>
<style>{style}</style>
<div style={{ animation: 'blink-animation 3s infinite' }}>{children}</div>
</>
);
};
|