Preview: Block im WOMS

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
ClaudeandClaude Sonnet 5.5 committed 2026-09-30 21:06:53 +00:00
1 parent 0f884e41e8
commit 2de846436b
6 files changed
+369 -1

No files matched your search

+20
View File
@@ -1,6 +1,7 @@
import { useState } from 'react'
import { FaCodeBranch } from 'react-icons/fa'
import { FaLinkSlash } from 'react-icons/fa6'
import PreviewBlock from './PreviewBlock'
import GiteaLinkButton from './GiteaLinkButton'
import PreviewLinkButton from './PreviewLinkButton'
import { suggestSubdomain } from '../lib/subdomain'
@@ -39,6 +40,7 @@ export default function AssignedProjectCard({ project, onUnassign, showActions =
const [previewMessage, setPreviewMessage] = useState('')
const [pushBusy, setPushBusy] = useState(false)
const [pushMessage, setPushMessage] = useState('')
const [showPreviewBlock, setShowPreviewBlock] = useState(false)
const openPreviewInput = () => {
setSubdomain(suggestSubdomain(customerName, project.projectName))
@@ -110,6 +112,24 @@ export default function AssignedProjectCard({ project, onUnassign, showActions =
<StatusBadge label="Provisioning" value={project.provisioningStatus} />
</div>
{showActions && (
<div style={{ marginTop: 10 }}>
<button
type="button"
className="btn btn-sm"
aria-expanded={showPreviewBlock}
onClick={() => setShowPreviewBlock((v) => !v)}
>
Preview {showPreviewBlock ? '▴' : '▾'}
</button>
{showPreviewBlock && (
<div style={{ marginTop: 8 }}>
<PreviewBlock projectId={project.$id} />
</div>
)}
</div>
)}
{showActions && (
<div style={{ marginTop: 10 }}>
<div style={{ display: 'flex', gap: 8, flexWrap: 'wrap', alignItems: 'center' }}>