Files
supabase/apps/studio/components/interfaces/DiskManagement/DiskCountdownRadial.tsx
Joshen LimandJonathan Summers-Muir 07699ad76b Chore/disk attributes mangement (#29219)
* init

* moar

* moat

* moar

* add read replica bar

* moar

* Update DiskMangementPanelForm.tsx

* added temp state mang to test

* moar

* Prepare react queries + data from API for disk mgt

* moat

* moat

* moar

* Update DiskMangementReviewAndSubmitDialog.tsx

* badge updates

* Hook up actual endpoints for E2E testing, but commented out for now for local dev

* Hook up real data + clean up files and add tests

* Update APi types

* Hook up E2E and fix all validation logic

* Only show new disk mgt UI for orb billing

* Add note on RRs 25% more disk size

* Add state to handle free plan for disk mgt

* Update increase disk size CTA in reports/database

* Fix file spelling errors

* Address feedback

* Fix missing framer motion package in ui

* Address comments

* Address feedabck

* Minor fix

* Use new disk util endpoint

* Remove unused import

* Address feedback

* More addressing of feedback

* Update pricing details for IO2 - no included disk size

---------

Co-authored-by: Jonathan Summers-Muir <MildTomato@users.noreply.github.com>
2024-09-13 11:51:51 +08:00

36 lines
1.3 KiB
TypeScript

import { AnimatePresence, motion } from 'framer-motion'
import { COOLDOWN_DURATION } from 'data/config/disk-attributes-update-mutation'
import { Card, CardContent } from 'ui'
import CountdownTimerRadial from '../../ui/CountdownTimer/CountdownTimerRadial'
import CountdownTimerSpan from '../../ui/CountdownTimer/CountdownTimerSpan'
export function DiskCountdownRadial({ remainingTime }: { remainingTime: number }) {
const progressPercentage = (remainingTime / COOLDOWN_DURATION) * 100
return (
<AnimatePresence>
{remainingTime !== 0 && (
<motion.div
initial={{ opacity: 0, height: 0 }}
animate={{ opacity: 1, height: 'auto' }}
exit={{ opacity: 0, height: 0 }}
transition={{ duration: 0.2 }}
>
<Card className="px-2 rounded-none">
<CardContent className="py-3 flex gap-3 px-3 items-center">
<CountdownTimerRadial progress={progressPercentage} />
<div className="flex flex-col">
<p className="text-foreground-lighter text-sm p-0">
6-hour wait period between disk modifications
</p>
<CountdownTimerSpan seconds={remainingTime} />
</div>
</CardContent>
</Card>
</motion.div>
)}
</AnimatePresence>
)
}