@coinmeca/ui
Version:
This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
30 lines • 950 B
JSX
'use client';
export default function TextCollapse({ text, condition }) {
if (!text && text === "")
return;
return (<span style={{
position: "relative",
display: "flex",
alignItems: "center",
justifyContent: "center",
}}>
{Object.values(text).map((character, i) => {
return (<span key={i} style={{
...(character === " " && {
minWidth: '0.5ch'
}),
...(i !== 0 && {
...(condition && {
position: "absolute",
opacity: 0,
// transition: ".15s ease",
}),
}),
}}>
{character}
</span>);
})}
</span>);
}
;
//# sourceMappingURL=TextCollapse.jsx.map