Use Campaign type in useCampaigns.

This commit is contained in:
Gan Eng Chin 2022-12-19 20:54:01 +08:00
parent c67e479162
commit 558ddf2609
No known key found for this signature in database
GPG Key ID: 94D5D972860ADB01
1 changed files with 15 additions and 5 deletions

View File

@ -1,5 +1,15 @@
/**
* Internal dependencies
*/
import { Campaign } from '~/marketing/types';
type UseCampaignsType = {
loading: boolean;
data: Array< Campaign >;
};
// // TODO: testing for loading state.
// export const useCampaigns = () => {
// export const useCampaigns = (): UseCampaignsType => {
// return {
// loading: true,
// data: [],
@ -7,7 +17,7 @@
// };
// TODO: testing for empty data.
// export const useCampaigns = () => {
// export const useCampaigns = (): UseCampaignsType => {
// return {
// loading: false,
// data: [],
@ -15,7 +25,7 @@
// };
// TODO: testing with campaigns data.
export const useCampaigns = () => {
export const useCampaigns = (): UseCampaignsType => {
return {
loading: false,
data: [
@ -35,7 +45,7 @@ export const useCampaigns = () => {
icon: 'https://woocommerce.com/wp-content/plugins/wccom-plugins/marketing-tab-rest-api/icons/google.svg',
id: 'gla-campaign-02',
title: 'Performance Max 02',
description: 'New Zealand',
description: '6 countries',
cost: '$50',
manageUrl: 'https://www.google.com/manage-campaign',
},
@ -45,7 +55,7 @@ export const useCampaigns = () => {
icon: 'https://woocommerce.com/wp-content/plugins/wccom-plugins/marketing-tab-rest-api/icons/google.svg',
id: 'gla-campaign-03',
title: 'Performance Max 03',
description: 'New Zealand',
description: '10 countries • 15 Sep - 31 Oct 2022',
cost: '$50',
manageUrl: 'https://www.google.com/manage-campaign',
},