import {faBook} from "@fortawesome/free-solid-svg-icons" import {FontAwesomeIcon} from "@fortawesome/react-fontawesome" import * as React from "react" import {useCacheContext} from "../../contexts/cache" import {ManagedResource} from "../../hooks/useManagedViewSet" import {SophonNotebook} from "../../types/SophonTypes" import {Link} from "../elements/Link" import {ResourcePanel} from "../elements/ResourcePanel" import {NotebookDeleteButton} from "./NotebookDeleteButton" import {NotebookLockButton} from "./NotebookLockButton" import {NotebookStartButton} from "./NotebookStartButton" import {NotebookStopButton} from "./NotebookStopButton" import {NotebookUnlockButton} from "./NotebookUnlockButton" export interface NotebookResourcePanelProps { resource: ManagedResource, } export function NotebookResourcePanel({resource}: NotebookResourcePanelProps): JSX.Element { const cache = useCacheContext() const locked_by = cache?.getUserById(resource.value.locked_by)?.value.username return ( {resource.value.name} { resource.value.locked_by ? `Locked by ${locked_by}` : null } ) }