File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11import React from 'react' ;
2- interface Props { label ?: string ; className ?: string ; orientation ?: 'horizontal' | 'vertical' ; }
3- const Divider : React . FC < Props > = ( { label, className = '' , orientation = 'horizontal' } ) => {
4- if ( orientation === 'vertical' ) return < div className = { 'w-px bg-gray-200 dark:bg-gray-700 self-stretch ' + className } /> ;
5- if ( label ) return (
6- < div className = { 'flex items-center gap-4 ' + className } >
7- < div className = 'flex-1 h-px bg-gray-200 dark:bg-gray-700' />
8- < span className = 'text-sm text-gray-500 font-medium' > { label } </ span >
9- < div className = 'flex-1 h-px bg-gray-200 dark:bg-gray-700' />
10- </ div >
11- ) ;
12- return < hr className = { 'border-gray-200 dark:border-gray-700 ' + className } /> ;
13- } ;
2+ interface Props { text ?: string ; className ?: string ; }
3+ const Divider : React . FC < Props > = ( { text, className = '' } ) => (
4+ < div className = { 'flex items-center gap-4 ' + className } >
5+ < div className = 'flex-1 h-px bg-gray-200 dark:bg-gray-700' />
6+ { text && < span className = 'text-sm text-gray-400 font-medium' > { text } </ span > }
7+ < div className = 'flex-1 h-px bg-gray-200 dark:bg-gray-700' />
8+ </ div >
9+ ) ;
1410export default Divider ;
You can’t perform that action at this time.
0 commit comments