diff --git a/public/folder.svg b/public/folder.svg new file mode 100644 index 0000000..fe14dd6 --- /dev/null +++ b/public/folder.svg @@ -0,0 +1,3 @@ + + + diff --git a/src/components/molecules/topList/TopList.stories.tsx b/src/components/molecules/topList/TopList.stories.tsx new file mode 100644 index 0000000..e6a8a47 --- /dev/null +++ b/src/components/molecules/topList/TopList.stories.tsx @@ -0,0 +1,26 @@ +import type { Meta, StoryObj } from '@storybook/react'; +import { TopList } from './TopList'; + +const meta: Meta = { + title: 'components/TopList', + component: TopList, +}; + +export default meta; +type Story = StoryObj; + +export const inprogress: Story = { + args: { + label: 'text', + currentCount: 0, + totalCount: 8, + }, +}; + +export const complete: Story = { + args: { + label: 'text', + currentCount: 8, + totalCount: 8, + }, +}; diff --git a/src/components/molecules/topList/TopList.tsx b/src/components/molecules/topList/TopList.tsx new file mode 100644 index 0000000..1926645 --- /dev/null +++ b/src/components/molecules/topList/TopList.tsx @@ -0,0 +1,30 @@ +import Folder from '../../../../public/folder.svg'; + +interface TopListProps { + label: string; + currentCount: number; + totalCount: number; +} + +export const TopList = ({ label, currentCount, totalCount }: TopListProps) => { + const isCompleted = currentCount === totalCount; + return ( +
+
+ + {isCompleted ? '완료' : `${currentCount}/${totalCount}`} + +
+ + + + + {label} + +
+ ); +}; diff --git a/src/components/molecules/topList/index.ts b/src/components/molecules/topList/index.ts new file mode 100644 index 0000000..e03aa6a --- /dev/null +++ b/src/components/molecules/topList/index.ts @@ -0,0 +1 @@ +export { TopList } from './TopList';