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

clippingkk / web / #1178

21 Aug 2025 10:49AM UTC coverage: 0.523% (-0.02%) from 0.546%
#1178

push

web-flow
Merge c060881fd into 4eea96e38

30 of 448 branches covered (6.7%)

Branch coverage included in aggregate %.

12 of 7134 new or added lines in 368 files covered. (0.17%)

3 existing lines in 3 files now uncovered.

147 of 33423 relevant lines covered (0.44%)

8.69 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
import { useTranslation } from '@/i18n/client'
×
4
import MarkdownPreview from './md-preview'
×
5

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

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

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

×
NEW
45
      <div className='mt-2'>
×
46
        {activeTab === 'edit' ? (
×
NEW
47
          <div className='relative'>
×
48
            <textarea
×
49
              rows={8}
×
NEW
50
              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'
×
51
              value={value}
×
52
              onChange={(e) => onValueChange(e.target.value)}
×
53
              placeholder={t('app.clipping.comments.placeholder') ?? ''}
×
54
              style={{
×
55
                minHeight: '184px',
×
56
                resize: 'vertical',
×
57
              }}
×
58
            />
×
59
          </div>
×
60
        ) : (
×
NEW
61
          <div className='bg-opacity-90 dark:bg-opacity-90 min-h-[184px] rounded-md bg-gray-100 p-4 dark:bg-gray-800'>
×
62
            <MarkdownPreview value={value} />
×
63
          </div>
×
64
        )}
×
65
      </div>
×
66
    </div>
×
67
  )
×
68
}
×
69

×
70
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