Files
UT-Registration-Plus/src/views/components/common/Divider.tsx
Preston Cook ee4c6ce699 feat(ui): update popup and course blocks (#506)
* feat(ui): add time and location to popup

* feat(ui): memoize meeting times

* feat(ui): remove resizing

* feat(ui): add no select to copy course id button

* feat(ui): complete update to popup and course blocks

* chore: update settings page

* chore: fix types

* fix(ui): update spacing, padding, and remove last updated section

* chore: fix type issues

* fix(ui): update borders to offwhite/50

* fix(ui): apply proper offwhite styling

* fix(ui): add unique key to async courses in bottom bar
2025-02-13 18:07:05 -06:00

48 lines
1.3 KiB
TypeScript

import clsx from 'clsx';
import React from 'react';
/**
* Props for the Divider component
*
* @param orientation - Orientation of the divider (horizontal or vertical)
* @param size - Size of the divider (forwards to width or height in CSS)
* @param className - Additional classes to be added to the divider
* @param testId - Test id for the divider
*/
export type DividerProps = {
orientation: 'horizontal' | 'vertical';
size: React.CSSProperties['width' | 'height'];
className?: string;
testId?: string;
};
/**
* This is a reusable divider component that can be used to separate content
*
* @returns A divider component
*
* @example
* ```tsx
* <Divider size="2.5rem" orientation="vertical" />
* ```
*
* @example
* ```tsx
* <Divider size="19px" orientation="horizontal" />
* ```
*/
export default function Divider({ className, testId, size, orientation }: DividerProps): JSX.Element {
const style: React.CSSProperties =
orientation === 'horizontal'
? { width: size, borderBottomWidth: '1px' }
: { height: size, borderRightWidth: '1px' };
return (
<div
style={style}
data-testid={testId}
className={clsx('border-solid border-ut-offwhite/50 w-0 h-0', className)}
/>
);
}