Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import * as React from 'react';
import { getExtensionSlot, ErrorInfoProps } from 'piral-core';
import {
NotFoundErrorInfo,
PageErrorInfo,
LoadingErrorInfo,
FeedErrorInfo,
FormErrorInfo,
UnknownErrorInfo,
} from './errors';
const ExtensionSlot = getExtensionSlot('error');
function getErrorInfo(props: ErrorInfoProps) {
switch (props.type) {
case 'not_found':
return ;
case 'page':
return ;
case 'loading':
return ;
case 'feed':
return ;
case 'form':
return ;
default:
return ;
}
import * as React from 'react';
import { getExtensionSlot, useGlobalState } from 'piral-core';
import { DashboardProps } from 'piral-ext';
import { DashboardContainerProps, TileProps } from '../types';
const ExtensionSlot = getExtensionSlot('dashboard');
export interface DashboardCreator {
DashboardContainer: React.ComponentType;
Tile: React.ComponentType;
}
export function createDashboard({ DashboardContainer, Tile }: DashboardCreator): React.FC {
return props => {
const tiles = useGlobalState(s => s.components.tiles);
return (
<>
{Object.keys(tiles).map(tile => {
const {
component: Component,