1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-21 04:19:37 +02:00

Apps actions and reducer

This commit is contained in:
unknown 2021-05-10 19:02:16 +02:00
parent 2acc3b72ec
commit 78acede8ab
15 changed files with 230 additions and 27 deletions

View file

@ -1,15 +1,31 @@
import classes from './AppCard.module.css';
import Icon from '../../UI/Icon/Icon';
const AppCard = (): JSX.Element => {
import { App } from '../../../interfaces';
interface ComponentProps {
app: App;
}
const AppCard = (props: ComponentProps): JSX.Element => {
const iconParser = (mdiName: string): string => {
let parsedName = mdiName
.split('-')
.map((word: string) => `${word[0].toUpperCase()}${word.slice(1)}`)
.join('');
parsedName = `mdi${parsedName}`;
return parsedName;
}
return (
<div className={classes.AppCard}>
<div className={classes.AppCardIcon}>
<Icon icon='mdiBookOpenBlankVariant' />
<Icon icon={iconParser(props.app.icon)} />
</div>
<div className={classes.AppCardDetails}>
<h5>plex</h5>
<a href="/">plex.example.com</a>
<h5>{props.app.name}</h5>
<a href="/">{props.app.url}</a>
</div>
</div>
)