Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
162 commits
Select commit Hold shift + click to select a range
371b9ca
Merge pull request #35 from Intina47/mambaV2-working-branch
Intina47 Nov 25, 2023
c13feef
Merge pull request #36 from Intina47/mambaV2-working-branch
Intina47 Nov 25, 2023
1e725b1
favico
Intina47 Nov 26, 2023
b0f284b
Bump @types/node from 20.8.10 to 20.10.0
dependabot[bot] Nov 27, 2023
4213018
Add axios and ink packages
Intina47 Nov 28, 2023
37ff744
Add footer component and styles for mobile
Intina47 Nov 28, 2023
9670d8a
Add Footer component and API endpoint for latest
Intina47 Nov 28, 2023
2526209
Update PAT and repository information
Intina47 Nov 28, 2023
055dc80
Merge pull request #37 from Intina47/dependabot/npm_and_yarn/types/no…
Intina47 Nov 28, 2023
e293b9a
Update env and footer styling
Intina47 Nov 28, 2023
ba43239
Update footer styling
Intina47 Nov 28, 2023
c820237
Update latest project link
Intina47 Nov 28, 2023
d053925
Update favicon file
Intina47 Nov 28, 2023
d6f70ad
Update isaiahNtina.pdf
Intina47 Nov 30, 2023
af5c8bc
Add Analytics component to layout
Intina47 Dec 1, 2023
26e0c05
Fix puppeteer import and add NODE_ENV variable
Intina47 Dec 4, 2023
1fa64a3
Update environment variables and puppeteer
Intina47 Dec 4, 2023
70650a9
Update environment variables and puppeteer import
Intina47 Dec 4, 2023
34de787
Fix puppeteer launch arguments
Intina47 Dec 4, 2023
1f7419a
Update puppeteer import in fun.js
Intina47 Dec 4, 2023
641723e
Update NODE_ENV value in .env file
Intina47 Dec 4, 2023
7c325b9
Remove unused dependencies and update package.json
Intina47 Dec 4, 2023
50ca96f
Update footer.tsx
Intina47 Dec 6, 2023
29ed3da
Add ChristmasIcons component and update TerminalLayout and layout com…
Intina47 Dec 15, 2023
6000e1b
[ImgBot] Optimize images
ImgBotApp Dec 15, 2023
d1188fb
add mongoDB
Intina47 Dec 18, 2023
7dd7d9d
solve the issue on puppeteer
Intina47 Dec 18, 2023
af3deff
Bump eslint from 8.50.0 to 8.56.0
dependabot[bot] Dec 18, 2023
b60afee
Bump eslint-config-next from 14.0.1 to 14.0.4
dependabot[bot] Dec 18, 2023
f951d24
Bump @typescript-eslint/parser from 6.7.2 to 6.15.0
dependabot[bot] Dec 18, 2023
a927047
Update .env
Intina47 Dec 18, 2023
8b06cbb
Merge pull request #45 from Intina47/dependabot/npm_and_yarn/typescri…
Intina47 Dec 19, 2023
ef4307c
Merge pull request #43 from Intina47/dependabot/npm_and_yarn/eslint-8…
Intina47 Dec 19, 2023
a844b6e
Merge pull request #42 from Intina47/imgbot
Intina47 Dec 19, 2023
5d3fc42
Merge pull request #40 from Intina47/dependabot/npm_and_yarn/eslint-c…
Intina47 Dec 19, 2023
819972f
Bump @types/react-dom from 18.2.7 to 18.2.18
dependabot[bot] Dec 25, 2023
bf3e39e
Bump postcss from 8.4.31 to 8.4.32
dependabot[bot] Dec 25, 2023
2b1d012
Bump isomorphic-git from 1.25.0 to 1.25.2
dependabot[bot] Dec 25, 2023
ce6ebfd
goodbye christmas
Intina47 Jan 4, 2024
8af9c72
Merge pull request #48 from Intina47/dependabot/npm_and_yarn/isomorph…
Intina47 Jan 5, 2024
c592461
Merge pull request #47 from Intina47/dependabot/npm_and_yarn/postcss-…
Intina47 Jan 5, 2024
8a543a3
Merge pull request #46 from Intina47/dependabot/npm_and_yarn/types/re…
Intina47 Jan 5, 2024
6ef2eaf
Bump p-queue from 7.4.1 to 8.0.1
dependabot[bot] Jan 8, 2024
23ef889
Bump follow-redirects from 1.15.3 to 1.15.4
dependabot[bot] Jan 11, 2024
5bafb97
Add PromptConfiguration component
Intina47 Jan 14, 2024
f36a080
Add prompt configuration to terminal component
Intina47 Jan 14, 2024
6d3daa1
Add base prompt configuration
Intina47 Jan 14, 2024
acf83e4
Add readme content to terminal component
Intina47 Jan 14, 2024
0bcdbd3
Remove introductory paragraph from README
Intina47 Jan 14, 2024
ec73f39
Remove commented code and unused code in TerminalLayout component
Intina47 Jan 14, 2024
9837045
Update dependabot.yml
Intina47 Jan 14, 2024
7277295
Bump eslint-plugin-n from 16.1.0 to 16.6.2
dependabot[bot] Jan 14, 2024
b17f582
Bump framer-motion from 10.16.4 to 10.18.0
dependabot[bot] Jan 14, 2024
2d437f8
Bump autoprefixer from 10.4.15 to 10.4.17
dependabot[bot] Jan 22, 2024
8f570b0
Merge pull request #56 from Intina47/dependabot/npm_and_yarn/autopref…
Intina47 Jan 22, 2024
40f7f07
Merge pull request #55 from Intina47/dependabot/npm_and_yarn/framer-m…
Intina47 Jan 22, 2024
c8dce5c
Merge pull request #54 from Intina47/dependabot/npm_and_yarn/eslint-p…
Intina47 Jan 22, 2024
1fe12f3
Merge pull request #52 from Intina47/dependabot/npm_and_yarn/follow-r…
Intina47 Jan 22, 2024
3465164
Merge pull request #50 from Intina47/dependabot/npm_and_yarn/p-queue-…
Intina47 Jan 22, 2024
ca7a0da
Add CV
Intina47 Feb 1, 2024
81de4c2
Delete public/isaiahNtina.pdf
Intina47 Feb 1, 2024
c0fbff6
Rename isaiah Ntina.pdf to isaiahNtina.pdf
Intina47 Feb 1, 2024
8d75af6
remove desc
Intina47 Feb 18, 2024
ee75f8b
Add language statistics to terminal component
Intina47 Feb 18, 2024
f0f89a3
Update daisyui themes in tailwind.config.ts
Intina47 Mar 1, 2024
a6b4833
Add ignoredPullRequestBranches setting to .vscode/settings.json
Intina47 Mar 1, 2024
9045486
Update data-theme to dark in layout.tsx
Intina47 Mar 1, 2024
077726e
Update main layout in page component
Intina47 Mar 1, 2024
350e544
Refactor useEffect in TerminalLayout component
Intina47 Mar 1, 2024
290de06
Refactor languagestats.js file
Intina47 Mar 1, 2024
62f1e03
Update main layout in page.tsx
Intina47 Mar 1, 2024
8a75f25
Update isaiahNtina.pdf
Intina47 Mar 1, 2024
881c215
Add Nanéu, a discord jobs bot, to the footer
Intina47 Mar 20, 2024
f593598
Update languageStats.md
Intina47 Mar 20, 2024
556036a
Refactor languagestats.js API handler
Intina47 Mar 20, 2024
112d5ea
Update isaiahNtina.pdf
Intina47 Mar 20, 2024
caaa356
Fix formatting in footer component
Intina47 Mar 20, 2024
13b1c8e
Refactor languagestats.js file
Intina47 Mar 20, 2024
fe3eae3
Add InspirationCards component to the project
Intina47 Apr 10, 2024
f6873f5
Refactor InspoComponent to fetch and display source previews
Intina47 Apr 10, 2024
a1a57ba
Add InspirationCards component and handle explore click in TerminalLa…
Intina47 Apr 10, 2024
dd41995
Refactor InspoComponent to remove unused code and improve readability
Intina47 Apr 10, 2024
e04a8d2
Add C.S. Lewis quote to InspirationCards component
Intina47 Apr 10, 2024
f1b2b4f
Refactor code formatting and improve readability in InspirationCards …
Intina47 Apr 10, 2024
2c185d3
Add new inspirational quotes to InspirationCards component
Intina47 Apr 10, 2024
3152cd9
Add new inspirational quotes to InspirationCards component
Intina47 Apr 10, 2024
111e809
Update inspirational quotes in InspirationCards component
Intina47 Apr 10, 2024
f0e7613
Refactor InspoComponent to remove unused code and improve readability
Intina47 Apr 10, 2024
5a06699
Update InspoComponent to improve bottom margin in Inspocard
Intina47 Apr 10, 2024
753a8b2
Improve bottom margin and add rounded corners to Inspocard in InspoCo…
Intina47 Apr 10, 2024
f2cdd05
Update button styling in TerminalLayout component
Intina47 Apr 10, 2024
f2bddaf
Update bottom margin and add rounded corners to Inspocard in InspoCom…
Intina47 Apr 10, 2024
7b28eeb
Update bottom margin and add rounded corners to Inspocard in InspoCom…
Intina47 Apr 11, 2024
a01ca73
Add input field pulse animation to TerminalLayout component
Intina47 Apr 11, 2024
06d4c1c
Add react-hook-form package to dependencies
Intina47 Apr 11, 2024
f043d69
Update inspirational quotes in InspirationCards component
Intina47 Apr 11, 2024
6a46e03
Add QuoteForm component for submitting quotes in admin panel
Intina47 Apr 11, 2024
9a0fe33
Add quote schema and model for storing quotes in Animal.js
Intina47 Apr 11, 2024
a505548
Add QuoteForm component to pages directory
Intina47 Apr 11, 2024
83633fd
Update color scheme in globals.css
Intina47 Apr 12, 2024
6b7e1f0
Update HTML lang attribute to "en" in layout.tsx
Intina47 Apr 12, 2024
32d610f
Fix formatting issues in QuoteForm and Home components
Intina47 Apr 12, 2024
e1dd80d
Update InspirationCards.tsx
Intina47 Apr 13, 2024
186961f
Add string-similarity package to dependencies
Intina47 Apr 13, 2024
f125fb4
Add string-similarity package to dependencies
Intina47 Apr 13, 2024
c78047f
Add string-similarity package to Terminal component
Intina47 Apr 13, 2024
bdaadb0
Fix formatting issues in InspirationCards.tsx
Intina47 Apr 13, 2024
caa9144
Fix formatting issues in Terminal component
Intina47 Apr 13, 2024
cd5873e
Fix formatting issues in QuoteForm component
Intina47 Apr 13, 2024
03dc729
Update Brenda Laurel's source URL in InspirationCards.tsx
Intina47 Apr 13, 2024
ce8b538
Update Brenda Laurel's source URL in InspirationCards.tsx
Intina47 Apr 13, 2024
30f7087
Fix formatting issues in QuoteForm component
Intina47 Apr 13, 2024
77f0595
Update Brenda Laurel's quote formatting in InspirationCards.tsx
Intina47 Apr 13, 2024
0372b1a
Update Brenda Laurel's quote formatting and source URL in Inspiration…
Intina47 Apr 13, 2024
bb06306
Fix formatting issues in Terminal component
Intina47 Apr 13, 2024
b317e2f
Fix text size in Terminal component error messages
Intina47 Apr 13, 2024
fe60c1c
Add @heroicons/react package and update dependencies
Intina47 Apr 15, 2024
9725747
Update latest repository link in footer.tsx
Intina47 Apr 15, 2024
4f29009
Update .gitignore to include .env file
Intina47 Apr 15, 2024
3c9addd
Fix formatting issues in QuoteForm component
Intina47 Apr 15, 2024
f1ef26b
Refactor Animal model and remove unused Quote model
Intina47 Apr 15, 2024
375d573
Add Quote model for managing quotes in the application
Intina47 Apr 15, 2024
882dc51
Update QuoteFormPage to handle quote submission and API response
Intina47 Apr 15, 2024
4f16ba4
Add API endpoint for saving quotes
Intina47 Apr 15, 2024
cfd3ae2
Refactor API endpoint for saving quotes
Intina47 Apr 15, 2024
cd08909
Refactor handleQuoteSubmission function in QuoteFormPage
Intina47 Apr 15, 2024
069393c
Refactor Quote model to use single quotes for import statement and fi…
Intina47 Apr 15, 2024
e2b8bf5
Refactor Animal model and remove unused Quote model
Intina47 Apr 15, 2024
508118d
Refactor Animal model and remove unused Quote model
Intina47 Apr 15, 2024
7ef038d
Refactor InspirationCards component to use fetch API for getting quotes
Intina47 Apr 15, 2024
b8c38da
Add API endpoint for retrieving quotes
Intina47 Apr 15, 2024
3248754
Add manifest.json file for PWA support
Intina47 Apr 15, 2024
754547f
Update manifest.json with new image source
Intina47 Apr 15, 2024
1c8a6f4
introduce contact me
Intina47 Apr 20, 2024
fb22da1
Merge pull request #75 from Intina47/draft/priceless-worker
Intina47 Apr 20, 2024
c04e9e8
coming soon
Intina47 Apr 20, 2024
26d1664
talk to me now
Intina47 Apr 20, 2024
332c8e2
Merge pull request #76 from Intina47/draft/priceless-worker
Intina47 Apr 20, 2024
434b098
talk to me now
Intina47 Apr 20, 2024
7e88b98
Merge pull request #77 from Intina47/draft/priceless-worker
Intina47 Apr 20, 2024
92899af
fix null timeout
Intina47 Apr 20, 2024
ee5c464
Merge pull request #78 from Intina47/draft/priceless-worker
Intina47 Apr 20, 2024
03bdc81
Update link for Afro Beats Night Club in projects.md
Intina47 Apr 21, 2024
a5105e5
Bump daisyui from 3.7.7 to 4.10.2
dependabot[bot] Apr 22, 2024
e958e72
alter font for a better ux
Intina47 Apr 29, 2024
052995a
Fix "Talk to me" button timeout issue
Intina47 Apr 29, 2024
d8a1329
linter fix
Intina47 Apr 29, 2024
07101e5
Add NotesPage component to display notes dashboard
Intina47 Apr 29, 2024
036bc30
Add Navbar component to NotesPage
Intina47 Apr 29, 2024
3950f87
Add Navbar component to NotesPage
Intina47 Apr 29, 2024
8f28d58
Update styling for NotesDash component
Intina47 Apr 29, 2024
d0c0f6a
Update styling for Navbar component
Intina47 Apr 29, 2024
d9c4339
Add react-router-dom package and update dependencies
Intina47 Apr 29, 2024
03bf78d
updated cv
Intina47 May 6, 2024
d86a275
chore: Add FullScreenNote component for displaying notes in full scre…
Intina47 May 25, 2024
5b56762
Refactor FullScreenNote component to improve code readability and con…
Intina47 May 25, 2024
fe15a9d
Refactor FullScreenNote component to improve code readability and con…
Intina47 May 25, 2024
0f9e055
Merge pull request #79 from Intina47/dependabot/npm_and_yarn/daisyui-…
Intina47 May 27, 2024
478b225
remove notes pages
Intina47 May 28, 2024
ef4b87c
remote notes page
Intina47 May 28, 2024
a113ead
update homepage readme
Intina47 May 28, 2024
5c6bd85
style upgrade
Intina47 May 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .env
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@
NEXT_PUBLIC_EMAIL = isaiahntina47@gmail.com
CHROME_EXECUTABLE_PATH = '/Applications/Google Chrome.app/Contents/MacOS/Google Chrome';

1 change: 1 addition & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@ yarn-error.log*

# local env files
.env*.local

# vercel
.vercel
.env

# typescript
*.tsbuildinfo
Expand Down
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"githubPullRequests.ignoredPullRequestBranches": [
"main"
]
}
70 changes: 70 additions & 0 deletions app/components/ChristmasIcons.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
'use client';
import React from 'react';
import { christmasIcons } from '../constants';
import { useEffect, useState } from 'react';

const ChristmasIcons: React.FC = () => {
const [positions, setPositions] = useState<Array<{ left: number; top: number }>>([]);

const getRandomPosition = (): { left: number; top: number } => {
const left = Math.random() * 100;
const top = Math.random() * 100;
return { left, top };
};

const checkCollision = (newPosition: { left: number; top: number }): boolean => {
const collisionThreshold = 10;

for (const position of positions) {
if (
Math.abs(position.left - newPosition.left) < collisionThreshold &&
Math.abs(position.top - newPosition.top) < collisionThreshold
) {
return true; // Collision detected
}
}

return false; // No collision
};

useEffect(() => {
const newPositions: Array<{ left: number; top: number }> = [];

christmasIcons.forEach(() => {
let newPosition = getRandomPosition();

// Check for collisions and adjust position if needed
while (checkCollision(newPosition)) {
newPosition = getRandomPosition();
}

newPositions.push(newPosition);
});

setPositions(newPositions);
}, []); // Run once on component mount

return (
<>
{christmasIcons.map((icon, index) => (
<div
key={index}
style={{
position: 'absolute',
left: `${positions[index]?.left || 0}%`,
top: `${positions[index]?.top || 0}%`,
zIndex: -1,
}}
>
{icon.type === 'emoji' ? (
<span style={{ fontSize: '24px', filter: 'blur(0px)' }}>{icon.name}</span>
) : (
<img src={icon.content} alt={icon.description} style={{ width: '50px', filter: 'blur(0px)' }} />
)}
</div>
))}
</>
);
};

export default ChristmasIcons;
40 changes: 40 additions & 0 deletions app/components/InspirationCards.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
import React from 'react';
import Inspocard from './inspoComponent';

interface Quote {
quote: string;
source: string;
sourceUrl?: string;
}

const InspirationCards = () => {
const [quotes, setQuotes] = React.useState<Quote[]>([]);
React.useEffect(() => {
fetch('/api/get_quotes')
.then((res) => res.json())
.then((data) => {
setQuotes(data);
});
}, []);

return (
<div className="flex flex-wrap justify-center gap-4 mt-1 mb-1">
{quotes.length > 0 ? (
quotes.map((quote, index) => (
<Inspocard
key={index}
quote={quote.quote}
source={quote.source}
sourceUrl={quote.sourceUrl}
/>
))
) : (
<div className="text-center text-gray-600">
No quotes available at the moment. Check back later!
</div>
)}
</div>
);
};

export default InspirationCards;
23 changes: 23 additions & 0 deletions app/components/PromptConfiguration.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import React from 'react';
import { promt } from '../constants';

interface PromptConfigurationProps {
uniqueKey: string;
sanitizedInput: string;
}

const PromptConfiguration: React.FC<PromptConfigurationProps> = ({ uniqueKey, sanitizedInput }) => {
return (
<div>
<p className='text-white font-mono' key={uniqueKey + '-input'}>
<span className='text-red-500'>{promt[0].privilage}</span>
<span className='text-yellow-500'>{promt[0].connector}</span>
<span className='text-blue-500'>{promt[0].username}</span>
<span className='text-yellow-500'> ~ {promt[0].endofline} </span>
{sanitizedInput}
</p>
</div>
);
};

export default PromptConfiguration;
111 changes: 111 additions & 0 deletions app/components/admin/QuoteForm.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
// path: app/components/admin/QuoteForm.tsx
import React, { useState } from 'react';
import { useForm } from 'react-hook-form';
import { CheckCircleIcon, ExclamationCircleIcon } from '@heroicons/react/20/solid';

interface FormData {
quote: string;
source?: string;
sourceUrl?: string;
}

interface QuoteFormProps {
onSubmit: (data: FormData) => Promise<void>;
}

const QuoteForm = ({ onSubmit }: QuoteFormProps) => {
const { register, handleSubmit, formState: { errors }, reset } = useForm<FormData>();
const [submitting, setSubmitting] = useState(false);
const [submitStatus, setSubmitStatus] = useState<'idle' | 'success' | 'error'>('idle');

const handleFormSubmit = async (data: FormData) => {
setSubmitting(true);
try {
console.log('Submitting form data:', data); // Debugging
await onSubmit(data);
console.log('Form submission successful'); // Debugging
setSubmitStatus('success');
setTimeout(() => {
setSubmitStatus('success');
setSubmitting(false);
reset();
}, 5000);
} catch (error) {
console.error('Error submitting form:', error); // Debugging
setSubmitStatus('error');
setTimeout(() => {
setSubmitStatus('error');
setSubmitting(false);
}, 5000);
}
};

return (
<div className="mx-auto max-w-lg px-4">
<form onSubmit={handleSubmit(handleFormSubmit)} className="mt-4 bg-black p-4 rounded-lg shadow-md">
<div className="mb-4">
<label htmlFor="quote" className="block text-sm font-medium text-gray-500">Quote</label>
<textarea
{...register('quote', { required: true })}
onChange={() => setSubmitting(false)}
id="quote"
className="shadow-sm focus:ring-indigo-500 focus:border-indigo-500 mt-1 block w-full sm:text-sm text-white font-mono rounded-md py-2 px-3 bg-gray-500 focus:outline-none"
rows={5}
/>
{errors.quote && <p className="text-red-500 text-xs mt-1">Quote is required.</p>}
</div>
<div className="mb-4">
<label htmlFor="source" className="block text-sm font-medium text-gray-500">Source (Optional)</label>
<input
{...register('source')}
type="text"
id="source"
className="shadow-sm focus:ring-indigo-500 focus:border-indigo-500 mt-1 block w-full sm:text-sm text-white font-mono rounded-md py-2 px-3 bg-gray-500 focus:outline-none"
/>
</div>
<div className="mb-4">
<label htmlFor="sourceUrl" className="block text-sm font-medium text-gray-500">Source URL (Optional)</label>
<input
{...register('sourceUrl')}
type="url"
id="sourceUrl"
className="shadow-sm focus:ring-indigo-500 focus:border-indigo-500 mt-1 block w-full sm:text-sm text-white font-mono rounded-md py-2 px-3 bg-gray-500 focus:outline-none"
/>
</div>
<div className="mt-4">
<button
type="submit"
className={`w-full py-2 px-4 bg-blue-300 rounded-md font-mono text-white focus:outline-none ${
submitting ? 'bg-blue-300 hover:bg-blue-300' : 'bg-indigo-500 hover:bg-blue-300'
}`}
disabled={submitting}
>
{submitting ? (
<>
<svg className="animate-spin -ml-1 mr-3 h-5 w-5 text-white inline" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4"></circle>
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path>
</svg>
Submitting...
</>
) : submitStatus === 'success' ? (
<span className="flex items-center">
<CheckCircleIcon className="h-5 w-5 text-green-500 mr-2" />
Submitted!
</span>
) : submitStatus === 'error' ? (
<span className="flex items-center">
<ExclamationCircleIcon className="h-5 w-5 text-red-500 mr-2" />
Error Sending!
</span>
) : (
'Submit'
)}
</button>
</div>
</form>
</div>
);
};

export default QuoteForm;
61 changes: 61 additions & 0 deletions app/components/footer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// path: app/components/footer.tsx
import React, { useState, useEffect } from 'react';
import axios from 'axios';

const YOUR_PAT = process.env.GITHUB_PAT;

type CommitData = {
latestCommit: string;
commitmessage: string;
};

const Footer = () => {
const [Commit, setLatestCommit] = useState<CommitData>({ latestCommit: '', commitmessage: '' });

useEffect(() => {
const fetchLatestCommit = async () => {
try {
const response = await axios.get('/api/latest-commit', {
headers: {
Authorization: `Bearer ${YOUR_PAT}`,
},
});
setLatestCommit(response.data);
} catch (error) {
throw new Error(`Error: ${error}`);
}
};

fetchLatestCommit();
}, []);

return (
<div className="footerm">
{/* add my nanéu, my discord jobs bot to your server */}
<div className='footer-right mt-2 mb-2'>
<h1 className="text-white text-md font-bold">Meet Nanéu,</h1>
<p className="text-white mb-1 text-sm">A discord jobs bot. Invite Nanéu to your server and add it to your jobs channel. You can configure it to your own job preferences.</p>
<p className="text-yellow-500 text-sm">
<button className='bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 rounded' type='button'>
<a href="https://discord.com/oauth2/authorize?client_id=1217949022275506176" className='no-underline text-white' target="_blank" rel="noopener noreferrer">
Invite Nanéu to your server
</a>
</button>
</p>

</div>
<div className="footer-left">
<p className="text-white mb-1 text-sm">Current Project, Latest Github Commit</p>
<p className="text-yellow-500 text-sm">
<a id='latestrepo' href="https://github.com/Intina47/nan-u" className="no-underline text-current">
{Commit.latestCommit.slice(0, 12)}
</a>
:{' '}
<span className="text-white font-light text-sm">{Commit.commitmessage.length > 10 ? `${Commit.commitmessage.slice(0, 70)}...` : Commit.commitmessage}</span>
</p>
</div>
</div>
);
};

export default Footer;
30 changes: 30 additions & 0 deletions app/components/inspoComponent.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import React from 'react';

const Inspocard = ({ quote, source, sourceUrl }: { quote: string; source: string; sourceUrl?: string }) => {
return (
<div className="relative bg-gradient-to-r from-teal-500 to-blue-500 rounded-lg overflow-hidden shadow-md hover:shadow-xl">
<div className="p-6 text-white">
{quote.length > 30 ? (
<p className="text-sm font-mono leading-relaxed">
{quote}
</p>
) : (
<span className="text-sm font-bold leading-relaxed">
{quote}
</span>
)}
<div className="mt-4 flex items-center justify-between text-sm z-10">
<span>{source}</span>
{sourceUrl && (
<a href={sourceUrl} target="_blank" rel="noopener noreferrer" className="text-black bg-inherit">
Source
</a>
)}
</div>
</div>
<div className="absolute inset-x-0 bottom-0 mt-1 h-1/8 rounded-bl-lg rounded-br-lg bg-gradient-to-b from-teal-500 to-blue-500 animate-pulse z-0"></div>
</div>
);
};

export default Inspocard;
Loading