Add ExerciseAiQuickCreateTeaser Component and Update ExercisePickerModal
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 39s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m17s
Deploy Development / deploy (push) Successful in 40s
Test Suite / pytest-backend (push) Successful in 39s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 13s
Test Suite / k6 /health Baseline (push) Successful in 34s
Test Suite / playwright-tests (push) Successful in 1m17s
- Introduced the ExerciseAiQuickCreateTeaser component for a compact entry point in the exercise creation process. - Updated ExercisePickerModal to integrate the new teaser, allowing users to expand and create exercises directly from the search results. - Enhanced the quick create functionality with dynamic headlines and hints based on user input and context. - Refactored conditional rendering logic to improve user experience when no exercises are found.
This commit is contained in:
1 parent
5c882985e0
commit
a8633235f2
2 files changed
+90
-21
No files matched your search
@@ -3,6 +3,39 @@ import React from 'react'
|
||||
/**
|
||||
* Inline-Angebot: aus Suchstring neue Übung per KI anlegen (Fokusbereich + optional Titel/Skizze).
|
||||
*/
|
||||
/** Kompakter Einstieg unter Trefferliste — expandiert zum vollen Formular. */
|
||||
export function ExerciseAiQuickCreateTeaser({ onExpand, disabled = false }) {
|
||||
return (
|
||||
<div
|
||||
className="card"
|
||||
style={{
|
||||
padding: '12px 16px',
|
||||
marginTop: 16,
|
||||
borderColor: 'var(--border)',
|
||||
background: 'var(--surface2)',
|
||||
}}
|
||||
>
|
||||
<div
|
||||
style={{
|
||||
display: 'flex',
|
||||
flexWrap: 'wrap',
|
||||
gap: '10px 12px',
|
||||
alignItems: 'center',
|
||||
justifyContent: 'space-between',
|
||||
}}
|
||||
>
|
||||
<span style={{ fontSize: '0.92rem', lineHeight: 1.45 }}>
|
||||
<strong>Nichts Richtiges dabei?</strong>{' '}
|
||||
<span style={{ color: 'var(--text2)' }}>Neue Übung mit KI anlegen und direkt übernehmen.</span>
|
||||
</span>
|
||||
<button type="button" className="btn btn-secondary" disabled={disabled} onClick={() => onExpand?.()}>
|
||||
Neue Übung anlegen
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
||||
export default function ExerciseAiQuickCreateOffer({
|
||||
searchLabel,
|
||||
title,
|
||||
@@ -19,6 +52,7 @@ export default function ExerciseAiQuickCreateOffer({
|
||||
showSketchField = true,
|
||||
sketchOptional = true,
|
||||
hint,
|
||||
headline,
|
||||
}) {
|
||||
const canRun =
|
||||
!busy &&
|
||||
@@ -37,7 +71,7 @@ export default function ExerciseAiQuickCreateOffer({
|
||||
}}
|
||||
>
|
||||
<strong style={{ display: 'block', marginBottom: '6px', fontSize: '0.95rem' }}>
|
||||
Keine passende Übung gefunden
|
||||
{headline || 'Keine passende Übung gefunden'}
|
||||
</strong>
|
||||
<p style={{ margin: '0 0 12px', fontSize: '13px', color: 'var(--text2)', lineHeight: 1.45 }}>
|
||||
{hint ||
|
||||
|
||||
Reference in new issue
Block a user