ghost-portal/packages/page-files/src/Progress.tsx
Tarik Gul 384049fb6b
2025 (#11172)
* 2025

* update ci scripts to add access to scripts
2025-01-03 03:59:53 +02:00

47 lines
956 B
TypeScript

// Copyright 2017-2025 @polkadot/app-files authors & contributors
// SPDX-License-Identifier: Apache-2.0
import type { CSSProperties } from 'react';
import React from 'react';
import { styled } from '@polkadot/react-components';
export interface Props {
className?: string,
style?: CSSProperties,
progress: number
}
function Progress ({ className = '', progress, style }: Props) {
return (
<StyledDiv
className={`${className} highlight--border`}
style={style}
>
<div
className='file-progress-bar highlight--bg'
style={{ width: `${progress}%` }}
/>
</StyledDiv>
);
}
const StyledDiv = styled.div`
width: 100%;
background: unset;
overflow: hidden;
height: 1.4rem;
border-radius: 0.7rem;
border-style: solid;
border-width: 1px;
.file-progress-bar {
transition: width 100ms ease-in-out;
width: 0;
height: 100%;
}
`;
export default React.memo<Props>(Progress);