bigbuffet-rw/app/soapbox/components/ui/divider/divider.tsx

23 lines
579 B
TypeScript
Raw Normal View History

2022-06-07 08:24:40 -07:00
import React from 'react';
interface IDivider {
text?: string
}
/** Divider */
const Divider = ({ text }: IDivider) => (
<div className='relative' data-testid='divider'>
<div className='absolute inset-0 flex items-center' aria-hidden='true'>
2022-06-07 09:40:37 -07:00
<div className='w-full border-t-2 border-gray-100 dark:border-slate-700 border-solid' />
2022-06-07 08:24:40 -07:00
</div>
{text && (
<div className='relative flex justify-center'>
<span className='px-2 bg-white text-gray-400' data-testid='divider-text'>{text}</span>
</div>
)}
</div>
);
export default Divider;