diff options
Diffstat (limited to 'src/frontend/app/components/StopItemSkeleton.tsx')
| -rw-r--r-- | src/frontend/app/components/StopItemSkeleton.tsx | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/frontend/app/components/StopItemSkeleton.tsx b/src/frontend/app/components/StopItemSkeleton.tsx new file mode 100644 index 0000000..72f7506 --- /dev/null +++ b/src/frontend/app/components/StopItemSkeleton.tsx @@ -0,0 +1,42 @@ +import React from "react"; +import Skeleton, { SkeletonTheme } from "react-loading-skeleton"; +import "react-loading-skeleton/dist/skeleton.css"; + +interface StopItemSkeletonProps { + showId?: boolean; + stopId?: number; +} + +const StopItemSkeleton: React.FC<StopItemSkeletonProps> = ({ + showId = false, + stopId +}) => { + return ( + <SkeletonTheme baseColor="#f0f0f0" highlightColor="#e0e0e0"> + <li className="list-item"> + <div className="list-item-link"> + <span> + {showId && stopId && ( + <>({stopId}) </> + )} + </span> + <Skeleton + width={showId ? "60%" : "80%"} + style={{ display: "inline-block" }} + /> + <div className="line-icons" style={{ marginTop: "4px" }}> + <Skeleton + count={3} + width="30px" + height="20px" + inline={true} + style={{ marginRight: "0.5rem" }} + /> + </div> + </div> + </li> + </SkeletonTheme> + ); +}; + +export default StopItemSkeleton; |
