components.process.Tile.tsx Maven / Gradle / Ivy
import { toProcessRef } from 'components/process/utils/process';
import useStartProcess, { TranslatedProcessDefinition } from 'hooks/process';
import { useProcessRenderContext } from 'hooks/render';
import { TileCard, TileStyleProps } from './TileCard';
export type TileType = "directory" | "process"
export type TileInputProps = {
type : TileType
label?: string
path : string
process?: TranslatedProcessDefinition
tileProps?: Partial
onClick?: (e?: React.SyntheticEvent) => void
}
export interface TileProps extends TileInputProps {}
const Tile = ({onClick, tileProps, path, type, label, process}: TileProps) => {
switch (type) {
case 'directory':
return
case 'process':
return
}
}
type ProcessTileProps = {
process: TranslatedProcessDefinition
label?: string
tileProps?: Partial
onClick?: (e?: React.SyntheticEvent) => void
}
const ProcessTile = ({onClick, process, label, tileProps}: ProcessTileProps) => {
const startProcess = useStartProcess()
const handleStartProcess = (e: any) => {
startProcess(e, process, "PROCESS_OPEN")
onClick?.(e)
}
return
}
type DirectoryTileProps = {
path: string
label: string
tileProps?: Partial
}
export const DirectoryTile = ({path, label, tileProps}: DirectoryTileProps) => {
const {setPath} = useProcessRenderContext()
const handleClick = (e?: React.SyntheticEvent) => {
setPath(path)
}
return
}
export default Tile