• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

clippingkk / web / #1206

21 Mar 2026 03:38PM UTC coverage: 0.518% (-0.004%) from 0.522%
#1206

push

web-flow
Merge 5f4b297b9 into def495626

30 of 448 branches covered (6.7%)

Branch coverage included in aggregate %.

2 of 3517 new or added lines in 323 files covered. (0.06%)

1 existing line in 1 file now uncovered.

147 of 33737 relevant lines covered (0.44%)

8.61 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/components/markdown-editor/markdown-editor.tsx
1
import { DocumentTextIcon, PencilSquareIcon } from '@heroicons/react/24/solid'
×
2
import { useState } from 'react'
×
NEW
3

×
4
import { useTranslation } from '@/i18n/client'
×
NEW
5

×
6
import MarkdownPreview from './md-preview'
×
7

×
8
type MarkdownEditorProps = {
×
9
  value: string
×
10
  onValueChange: (v: string) => void
×
11
}
×
12

×
13
function MarkdownEditor(props: MarkdownEditorProps) {
×
14
  const { t } = useTranslation()
×
15
  const { value, onValueChange } = props
×
16
  const [activeTab, setActiveTab] = useState<'edit' | 'preview'>('edit')
×
17

×
18
  return (
×
NEW
19
    <div className="w-full">
×
NEW
20
      <div className="flex border-b border-gray-200 dark:border-gray-700">
×
21
        <button
×
NEW
22
          type="button"
×
23
          onClick={() => setActiveTab('edit')}
×
24
          className={`flex items-center px-4 py-2 text-sm font-medium ${
×
25
            activeTab === 'edit'
×
26
              ? 'border-b-2 border-blue-500 text-blue-600 dark:text-blue-400'
×
27
              : 'text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300'
×
28
          }`}
×
29
        >
×
NEW
30
          <PencilSquareIcon className="mr-2 h-4 w-4" />
×
31
          <span>{t('common.edit') || 'Edit'}</span>
×
32
        </button>
×
33
        <button
×
NEW
34
          type="button"
×
35
          onClick={() => setActiveTab('preview')}
×
36
          className={`flex items-center px-4 py-2 text-sm font-medium ${
×
37
            activeTab === 'preview'
×
38
              ? 'border-b-2 border-blue-500 text-blue-600 dark:text-blue-400'
×
39
              : 'text-gray-500 hover:text-gray-700 dark:text-gray-400 dark:hover:text-gray-300'
×
40
          }`}
×
41
        >
×
NEW
42
          <DocumentTextIcon className="mr-2 h-4 w-4" />
×
43
          <span>{t('common.preview') || 'Preview'}</span>
×
44
        </button>
×
45
      </div>
×
46

×
NEW
47
      <div className="mt-2">
×
48
        {activeTab === 'edit' ? (
×
NEW
49
          <div className="relative">
×
50
            <textarea
×
51
              rows={8}
×
NEW
52
              className="bg-opacity-90 dark:bg-opacity-90 block w-full rounded-md border-gray-300 bg-gray-100 p-3 text-gray-900 shadow-sm focus:border-blue-500 focus:ring-blue-500 sm:text-sm dark:border-gray-700 dark:bg-gray-900 dark:text-gray-100"
×
53
              value={value}
×
54
              onChange={(e) => onValueChange(e.target.value)}
×
55
              placeholder={t('app.clipping.comments.placeholder') ?? ''}
×
56
              style={{
×
57
                minHeight: '184px',
×
58
                resize: 'vertical',
×
59
              }}
×
60
            />
×
61
          </div>
×
62
        ) : (
×
NEW
63
          <div className="bg-opacity-90 dark:bg-opacity-90 min-h-[184px] rounded-md bg-gray-100 p-4 dark:bg-gray-800">
×
64
            <MarkdownPreview value={value} />
×
65
          </div>
×
66
        )}
×
67
      </div>
×
68
    </div>
×
69
  )
×
70
}
×
71

×
72
export default MarkdownEditor
×
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc