hooks/useDisplayPath
import { … } from 'zidane-ui'ui/src/hooks/useDisplayPath.tsx
Components#
PathDisplayProviderComponent#
Gives the components below each host's home folder.
function PathDisplayProvider(props: PathDisplayProviderProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | PathDisplayProviderProps | The |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| children? | ReactNode | The components that show paths. |
| homes | Readonly<Record<string, string | undefined>> | Each host's home folder, by host id ( |
PathDisplayScopeComponent#
Names the host of the paths below that don't name one: a server session's transcript shows its paths with the server's home folder.
function PathDisplayScope(props: PathDisplayScopeProps): ElementParameters
| Name | Type | Description |
|---|---|---|
| props | PathDisplayScopeProps | The |
Returns
ElementProps
| Name | Type | Description |
|---|---|---|
| children? | ReactNode | The components that show paths. |
| hostId? | string | null | The host the paths below are on ( |
Functions#
useDisplayPathFunction#
The nearest PathDisplayProvider's display; without one, paths show in full.
function useDisplayPath(): PathDisplayReturns
Interfaces#
PathDisplayInterface#
Shows paths with their machine's home folder as ~.
interface PathDisplayProperties
| Name | Type | Description |
|---|---|---|
| path | (path: string, hostId?: string | null) => string | A path: a leading home folder becomes |
| text | (text: string, hostId?: string | null) => string | A line holding paths ( |
PathDisplayProviderPropsInterface#
Props for PathDisplayProvider.
interface PathDisplayProviderPropsProperties
| Name | Type | Description |
|---|---|---|
| children? | ReactNode | The components that show paths. |
| homes | Readonly<Record<string, string | undefined>> | Each host's home folder, by host id ( |
PathDisplayScopePropsInterface#
Props for PathDisplayScope.
interface PathDisplayScopePropsProperties
| Name | Type | Description |
|---|---|---|
| children? | ReactNode | The components that show paths. |
| hostId? | string | null | The host the paths below are on ( |