All files / frontend/src/components ServiceHealthSkeleton.tsx

34.92% Statements 22/63
100% Branches 2/2
33.33% Functions 1/3
34.92% Lines 22/63

Press n or j to go to the next uncovered block, b, p or k for the previous block.

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 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 801x 1x         1x 1x 1x 1x 5x 5x 5x 5x 5x 5x 5x 5x 5x 5x 1x 1x   1x         1x                                                         1x                                         1x  
import React from 'react';
import Skeleton from './Skeleton';
 
/**
 * Skeleton loader for Services Status section
 */
const ServiceHealthSkeleton: React.FC = () => {
    return (
        <ul className="list-group list-group-flush">
            {[1, 2, 3, 4, 5].map((index) => (
                <li key={index} className="list-group-item px-0">
                    <div className="d-flex align-items-center justify-content-between">
                        <div className="flex-grow-1">
                            <Skeleton width="120px" height="20px" />
                        </div>
                        <div className="flex-shrink-0">
                            <Skeleton width="70px" height="24px" />
                        </div>
                    </div>
                </li>
            ))}
        </ul>
    );
};
 
/**
 * Skeleton loader for WebSDR cards
 */
export const WebSDRCardSkeleton: React.FC = () => {
    return (
        <>
            {[1, 2, 3, 4, 5, 6, 7].map((index) => (
                <div key={index} className="col-lg-3 col-md-4 col-sm-6">
                    <div className="card bg-light border-0 mb-3">
                        <div className="card-body">
                            <div className="d-flex align-items-center justify-content-between mb-2">
                                <Skeleton width="80px" height="20px" />
                                <Skeleton width="32px" height="32px" variant="circular" />
                            </div>
                            <Skeleton width="60px" height="16px" className="mb-2" />
                            <div className="d-flex align-items-center">
                                <div className="flex-grow-1 me-2">
                                    <Skeleton height="5px" />
                                </div>
                                <Skeleton width="30px" height="16px" />
                            </div>
                        </div>
                    </div>
                </div>
            ))}
        </>
    );
};
 
/**
 * Skeleton loader for stat cards
 */
export const StatCardSkeleton: React.FC = () => {
    return (
        <div className="card">
            <div className="card-body">
                <Skeleton width="100px" height="20px" className="mb-4" />
                <div className="row d-flex align-items-center">
                    <div className="col-9">
                        <Skeleton width="60px" height="32px" />
                    </div>
                    <div className="col-3 text-end">
                        <Skeleton width="40px" height="20px" />
                    </div>
                </div>
                <div className="m-t-30">
                    <Skeleton height="7px" />
                </div>
            </div>
        </div>
    );
};
 
export default ServiceHealthSkeleton;