diff --git a/src/stories/components/SchedulTotalHoursAndCourses.stories.tsx b/src/stories/components/SchedulTotalHoursAndCourses.stories.tsx new file mode 100644 index 000000000..7546c40dc --- /dev/null +++ b/src/stories/components/SchedulTotalHoursAndCourses.stories.tsx @@ -0,0 +1,27 @@ +import { Meta, StoryObj } from '@storybook/react'; +import ScheduleTotalHoursAndCourses from '@views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses'; + +const meta = { + title: 'Components/Common/ScheduleTotalHoursAndCourses', + component: ScheduleTotalHoursAndCourses, + parameters: { + layout: 'centered', + }, + tags: ['autodocs'], + argTypes: { + scheduleName: { control: 'text' }, + totalHours: { control: 'number' }, + totalCourses: { control: 'number' } + }, +} satisfies Meta; +export default meta; + +type Story = StoryObj; + +export const Default: Story = { + args: { + scheduleName: 'text', + totalHours: 22, + totalCourses: 8 + }, +}; \ No newline at end of file diff --git a/src/views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses.tsx b/src/views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses.tsx new file mode 100644 index 000000000..3e655e26c --- /dev/null +++ b/src/views/components/common/ScheduleTotalHoursAndCourses/ScheduleTotalHoursAndCourses.tsx @@ -0,0 +1,64 @@ +import clsx from 'clsx'; +import React, { useState } from 'react'; +import { Course, Status } from '@shared/types/Course'; +import { StatusIcon } from '@shared/util/icons'; +import { CourseColors, getCourseColors, pickFontColor } from '@shared/util/colors'; +import DragIndicatorIcon from '~icons/material-symbols/drag-indicator'; +import Text from '../Text/Text'; + +/** + * Props for ScheduleTotalHoursAndCourses + */ +export interface ScheduleTotalHoursAndCoursesProps { + scheduleName: string; + totalHours: number; + totalCourses: number; +} + +/** + * The ScheduleTotalHoursAndCourses as per the Labels and Details Figma section + * + * @param props ScheduleTotalHoursAndCoursesProps + */ +export default function ScheduleTotalHoursAndCoursess({ scheduleName, totalHours, totalCourses }: ScheduleTotalHoursAndCoursesProps): JSX.Element { + return ( +
+ + {`${scheduleName}: `} + + + {`${totalHours} HOURS`} + + + {`${totalCourses} courses`} + +
+ ); +}