[Tasks] Removing task list empty state (#1090)

* [Tasks] Removing task list empty state

* separate no-tasks story in a different file to handle cache issues
This commit is contained in:
Weiko
2023-08-06 00:05:40 +02:00
committed by GitHub
parent 2d35db14c0
commit 35395c2e67
8 changed files with 143 additions and 28 deletions

View File

@ -36,26 +36,21 @@ const StyledTaskRows = styled.div`
width: 100%;
`;
const StyledEmptyListMessage = styled.div`
color: ${({ theme }) => theme.font.color.secondary};
padding: ${({ theme }) => theme.spacing(4)};
`;
export function TaskList({ title, tasks }: OwnProps) {
return (
<StyledContainer>
<StyledTitle>
{title} <StyledCount>{tasks ? tasks.length : 0}</StyledCount>
</StyledTitle>
{tasks && tasks.length > 0 ? (
<StyledTaskRows>
{tasks.map((task) => (
<TaskRow key={task.id} task={task} />
))}
</StyledTaskRows>
) : (
<StyledEmptyListMessage>No task in this section</StyledEmptyListMessage>
<>
{tasks && tasks.length > 0 && (
<StyledContainer>
<StyledTitle>
{title} <StyledCount>{tasks.length}</StyledCount>
</StyledTitle>
<StyledTaskRows>
{tasks.map((task) => (
<TaskRow key={task.id} task={task} />
))}
</StyledTaskRows>
</StyledContainer>
)}
</StyledContainer>
</>
);
}