-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
7 changed files
with
81 additions
and
106 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import { IntlDate } from '~/components/IntlDate' | ||
|
||
export const Milestone = ({ | ||
name, | ||
date, | ||
}: { | ||
name: string | ||
date: Date | string | undefined | ||
}) => { | ||
return ( | ||
(date && ( | ||
<div | ||
style={{ | ||
display: 'flex', | ||
flexDirection: 'column', | ||
}} | ||
> | ||
<strong> | ||
<IntlDate date={new Date(date)} /> | ||
</strong> | ||
<small | ||
style={{ | ||
textTransform: 'uppercase', | ||
}} | ||
> | ||
{name}d | ||
</small> | ||
</div> | ||
)) || <></> | ||
) | ||
} |
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 |
---|---|---|
@@ -1,41 +1,47 @@ | ||
import { Form } from '@remix-run/react' | ||
import { IntlDate } from '~/components/IntlDate' | ||
import { Milestone } from './Milestone.js' | ||
|
||
export const Rule = ({ rule }: { rule: Rule }) => { | ||
return ( | ||
<tr> | ||
<th scope="row">{rule.matchers[0].value}</th> | ||
<td> | ||
<kbd> | ||
{rule.enabled | ||
? rule.actions[0].type === 'worker' | ||
? 'Deprecated' | ||
: 'Active' | ||
: 'Expired'} | ||
</kbd> | ||
</td> | ||
<td> | ||
<IntlDate date={new Date(rule.data?.expire)} /> | ||
</td> | ||
<td> | ||
{/* <Form method="delete"> | ||
<input type="text" name="zone" hidden value={rule.zone.id} /> | ||
<input type="text" name="rule" hidden value={rule.tag} /> | ||
<button type="submit" role="button" className="secondary"> | ||
🗑️ | ||
</button> | ||
</Form> */} | ||
</td> | ||
</tr> | ||
<details> | ||
<summary | ||
style={{ | ||
display: 'flex', | ||
alignItems: 'center', | ||
width: '100%', | ||
}} | ||
> | ||
<header | ||
style={{ | ||
display: 'flex', | ||
flexGrow: '1', | ||
alignItems: 'center', | ||
justifyContent: 'space-between', | ||
}} | ||
> | ||
{rule.matchers[0].value} | ||
<code> | ||
{rule.enabled | ||
? rule.actions[0].type === 'worker' | ||
? '⏲️ Deprecated' | ||
: '📨 Active' | ||
: '🗃️ Expired'} | ||
</code> | ||
</header> | ||
</summary> | ||
|
||
<article className="grid"> | ||
<Milestone name="📨 Activate" date={rule.data?.activate} /> | ||
<Milestone name="🗃️ Expire" date={rule.data?.expire} /> | ||
<Milestone name="⏲️ Deprecate" date={rule.data?.deprecate} /> | ||
<Milestone name="🗑️ Remove" date={rule.data?.remove} /> | ||
</article> | ||
{/* <Form method="delete"> | ||
<input type="text" name="zone" hidden value={rule.zone.id} readOnly /> | ||
<input type="text" name="rule" hidden value={rule.tag} readOnly /> | ||
<button type="submit" role="button" className="secondary"> | ||
🗑️ | ||
</button> | ||
</Form> */} | ||
</details> | ||
) | ||
} | ||
|
||
// <article className="text-blue-600 underline"> | ||
// <div className="grid"> | ||
// <h4>{rule.matchers[0].value}</h4> | ||
// <IntlDate date={new Date(rule.data?.expire)} /> | ||
// <button type="button" className="secondary"> | ||
// 🗑️ | ||
// </button> | ||
// </div> | ||
// </article> |
This file was deleted.
Oops, something went wrong.
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