mirror of
https://github.com/orangecoding/fredy.git
synced 2026-06-16 12:31:07 +00:00
moving to vite as build system 🎉
This commit is contained in:
29
ui/src/components/placeholder/Placeholder.jsx
Normal file
29
ui/src/components/placeholder/Placeholder.jsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import React from 'react';
|
||||
|
||||
import './Placeholder.less';
|
||||
|
||||
function getPlaceholder(rowCount, className) {
|
||||
const rows = [];
|
||||
for (let i = 0; i < rowCount; i++) {
|
||||
rows.push(<div className="place__line" key={i} />);
|
||||
}
|
||||
const clazz = `place ${className == null ? '' : className}`;
|
||||
return (
|
||||
<div className={clazz}>
|
||||
<div className="place__circle" />
|
||||
<div className="place__place_lines_wrapper">{rows}</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
export default function Placeholder({ rows = 3, ready = false, children, customPlaceholder, className }) {
|
||||
if (!ready) {
|
||||
if (customPlaceholder != null) {
|
||||
return customPlaceholder;
|
||||
}
|
||||
|
||||
return getPlaceholder(rows, className);
|
||||
}
|
||||
|
||||
return children;
|
||||
}
|
||||
Reference in New Issue
Block a user