-
Notifications
You must be signed in to change notification settings - Fork 342
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
10 changed files
with
192 additions
and
63 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,43 @@ | ||
import { styled } from '@mui/material'; | ||
import { motion } from 'framer-motion'; | ||
import React, { createContext, type ReactNode, useContext, useEffect, useState } from 'react'; | ||
|
||
export const TabsContext = createContext<{ init: boolean, current: string, setCurrent: (value: string) => void }>({ init: false, current: '', setCurrent () {} }); | ||
|
||
export function Tabs ({ children, defaultValue }: { children: ReactNode, defaultValue: string }) { | ||
const [current, setCurrent] = useState(defaultValue); | ||
const [init, setInit] = useState(false); | ||
useEffect(() => { | ||
setInit(true); | ||
}, []); | ||
|
||
return ( | ||
<TabsContext.Provider value={{ init, current, setCurrent }}> | ||
{children} | ||
</TabsContext.Provider> | ||
); | ||
} | ||
|
||
export const TabsList = styled('ul')` | ||
list-style: none; | ||
display: flex; | ||
align-items: center; | ||
justify-content: space-between; | ||
margin-bottom: 24px; | ||
flex-wrap: wrap; | ||
padding: 0 24px; | ||
gap: 12px; | ||
`; | ||
|
||
export function TabItem ({ value, children }: { value: string, children: ReactNode }) { | ||
const { current, setCurrent } = useContext(TabsContext); | ||
|
||
return ( | ||
<motion.li style={{ position: 'relative', padding: '8px 32px' }} initial={{ color: '#747474' }} animate={value === current ? { color: '#000000' } : { color: '#747474' }}> | ||
{(value === current) && <motion.div layout layoutId="active" style={{ zIndex: 0, pointerEvents: 'none', position: 'absolute', left: 0, top: 0, width: '100%', height: '100%', background: '#FFE895', borderRadius: 9999 }} />} | ||
<button style={{ cursor: 'pointer', fontSize: '24px', fontWeight: 700, position: 'relative', color: 'currentcolor', background: 'none', appearance: 'none', border: 'none' }} type="button" onClick={() => setCurrent(value)}> | ||
{children} | ||
</button> | ||
</motion.li> | ||
); | ||
} |
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,3 @@ | ||
- **Personal Website Hosting**: Create websites or blogs using WordPress or Joomla. | ||
- **RAG Agent Prototyping**: Develop RAG agents with your own knowledge base. | ||
- **Minecraft Server**: Run a personal Minecraft server, where you can play on with your friends all day. |
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,8 @@ | ||
TiDB Serverless is a highly scalable, vector search built-in, and cost-effective serverless database, which is dedicated to powering modern applications with simple solutions. <a href="https://www.pingcap.com/tidb-serverless/?utm_source=ossinsight&utm_medium=referral&utm_campaign=plg_OSScontribution_credit_05" target="_blank" rel="noopener noreferrer">Read more</a>. | ||
|
||
With it, you can: | ||
|
||
- Build highly scalable applications with ease | ||
- Leverage advanced features like vector search | ||
- Enjoy seamless integration with what you use | ||
- Pay only for what you use, and only beyond free credits |
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,2 @@ | ||
- **Start small businesses**: Power online stores, community forums, or customer feedback systems. | ||
- **Data API Backends**: Host small databases for managing small-scale workloads like API backend |
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 @@ | ||
- **Scale startups**: Deploy SaaS applications, analytics dashboards, or e-commerce platforms with of thousands users and continuous read/write operations. |
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 @@ | ||
- **Data-heavy applications**: Scale applications with distributed databases, handle enterprise-level systems, or power data-heavy industries like fintech or healthcare. |
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,2 @@ | ||
- **Power large-scale enterprises**: Handle millions of users with high performance and reliability requirements. | ||
- **Run mission-critical systems**: Support complex applications like fintech, gaming, or healthcare solutions. |
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