2021-11-02 02:43:46 +00:00
|
|
|
/**
|
|
|
|
* External dependencies
|
|
|
|
*/
|
|
|
|
import classnames from 'classnames';
|
|
|
|
|
2021-10-20 16:16:22 +00:00
|
|
|
/**
|
|
|
|
* Internal dependencies
|
|
|
|
*/
|
|
|
|
|
2022-04-04 18:38:27 +00:00
|
|
|
type TasksPlaceholderProps = {
|
|
|
|
numTasks?: number;
|
|
|
|
twoColumns?: boolean;
|
|
|
|
query: {
|
|
|
|
task?: string;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2023-05-17 01:54:31 +00:00
|
|
|
export const TaskListPlaceholder: React.FC< TasksPlaceholderProps > = (
|
|
|
|
props
|
|
|
|
) => {
|
|
|
|
const { numTasks = 5 } = props;
|
2021-11-02 02:43:46 +00:00
|
|
|
|
2021-10-20 16:16:22 +00:00
|
|
|
return (
|
2021-11-02 02:43:46 +00:00
|
|
|
<div
|
2023-05-17 01:54:31 +00:00
|
|
|
className={ classnames(
|
|
|
|
'woocommerce-task-dashboard__container setup-task-list'
|
|
|
|
) }
|
2021-11-02 02:43:46 +00:00
|
|
|
>
|
2021-10-20 16:16:22 +00:00
|
|
|
<div className="components-card is-size-large woocommerce-task-card woocommerce-homescreen-card is-loading">
|
|
|
|
<div className="components-card__header is-size-medium">
|
|
|
|
<div className="wooocommerce-task-card__header">
|
|
|
|
<div className="is-placeholder"> </div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<ul className="woocommerce-experimental-list">
|
|
|
|
{ Array.from( new Array( numTasks ) ).map( ( v, i ) => (
|
|
|
|
<li
|
|
|
|
tabIndex={ i }
|
|
|
|
key={ i }
|
|
|
|
className="woocommerce-experimental-list__item woocommerce-task-list__item"
|
|
|
|
>
|
|
|
|
<div className="woocommerce-task-list__item-before">
|
|
|
|
<div className="is-placeholder"></div>
|
|
|
|
</div>
|
|
|
|
<div className="woocommerce-task-list__item-text">
|
|
|
|
<div className="components-truncate components-text is-placeholder"></div>
|
|
|
|
</div>
|
|
|
|
</li>
|
|
|
|
) ) }
|
|
|
|
</ul>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default TaskListPlaceholder;
|