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:
parent
2acc3b72ec
commit
78acede8ab
15 changed files with 230 additions and 27 deletions
|
@ -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>
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue