Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions public/folder.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
26 changes: 26 additions & 0 deletions src/components/molecules/topList/TopList.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
import type { Meta, StoryObj } from '@storybook/react';
import { TopList } from './TopList';

const meta: Meta<typeof TopList> = {
title: 'components/TopList',
component: TopList,
};

export default meta;
type Story = StoryObj<typeof TopList>;

export const inprogress: Story = {
args: {
label: 'text',
currentCount: 0,
totalCount: 8,
},
};

export const complete: Story = {
args: {
label: 'text',
currentCount: 8,
totalCount: 8,
},
};
30 changes: 30 additions & 0 deletions src/components/molecules/topList/TopList.tsx
Original file line number Diff line number Diff line change
@@ -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 (
<div className='relative h-[171px] w-[171px]'>
<div
className={`absolute right-0 top-[7px] flex h-[42px] w-[67px] justify-center rounded-tr-[8px] pt-[3px] ${
isCompleted ? 'bg-primary-400' : 'bg-gray-300'
}`}
>
<span className='text-sm font-medium text-gray-900'>
{isCompleted ? '완료' : `${currentCount}/${totalCount}`}
</span>
</div>

<Folder className='absolute inset-0 z-0' />

<span className='absolute bottom-5 left-5 text-base font-semibold text-white'>
{label}
</span>
</div>
);
};
1 change: 1 addition & 0 deletions src/components/molecules/topList/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { TopList } from './TopList';