refactor: abstract inline ellipsis component

This commit is contained in:
unix
2020-05-28 20:52:30 +08:00
parent 2682131fc8
commit be7fb15bad

View File

@@ -0,0 +1,19 @@
import React from 'react'
const Ellipsis: React.FC<React.PropsWithChildren<{}>> = ({ children }) => {
return (
<span>
{children}
<style jsx>{`
span {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
min-width: 0;
}
`}</style>
</span>
)
}
export default React.memo(Ellipsis)