mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-06 12:54:20 +01:00
section 16: Phase 16: Documentation, container ports and full repository checks
This commit is contained in:
1 parent
81a9f0c8ef
commit
a383e57bc5
55 files changed
+4095
-59
No files matched your search
@@ -0,0 +1,18 @@
|
||||
import { useCallback } from 'react'
|
||||
import { useUrlParams } from './useUrlParams'
|
||||
|
||||
export function useOpenPreview(): (port: number, path?: string) => void {
|
||||
const { updateParams } = useUrlParams()
|
||||
|
||||
return useCallback(
|
||||
(port: number, path = '/') => {
|
||||
updateParams((params) => {
|
||||
params.set('dialog', 'preview')
|
||||
params.set('previewPort', String(port))
|
||||
params.set('previewPath', path)
|
||||
params.delete('mobileTab')
|
||||
}, 'push')
|
||||
},
|
||||
[updateParams],
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user