-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
76 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
export type SaveStatus = 'unsaved' | 'saving' | 'saved'; | ||
|
||
export default function SaveStatusIndicator({saveStatus}: {saveStatus: SaveStatus}) { | ||
switch (saveStatus) { | ||
case "unsaved": | ||
return <i className="fa-regular fa-circle" /> | ||
case "saving": | ||
return <i className="fa-solid fa-spinner animate-spin" /> | ||
case "saved": | ||
return <i className='fa-regular fa-circle-check' /> | ||
} | ||
} |
26 changes: 26 additions & 0 deletions
26
stories/Components/Indicators/SaveStatusIndicator.stories.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
import SaveStatusIndicator from '@/components/indicators/SaveStatusIndicator'; | ||
|
||
const meta = { | ||
title: 'Components/Indicators/SaveStatusIndicator', | ||
component: SaveStatusIndicator, | ||
parameters: { | ||
layout: 'fullscreen', | ||
}, | ||
tags: ['autodocs'], | ||
} satisfies Meta<typeof SaveStatusIndicator>; | ||
|
||
export default meta; | ||
type Story = StoryObj<typeof meta>; | ||
|
||
export const Saving: Story = { | ||
args: {saveStatus: "saving"}, | ||
}; | ||
|
||
export const Unsaved: Story = { | ||
args: {saveStatus: "unsaved"}, | ||
}; | ||
|
||
export const Saved: Story = { | ||
args: {saveStatus: "saved"}, | ||
}; |